Bug 750178 - Companion test suite. r=khuey

This commit is contained in:
David Rajchenbach-Teller 2012-07-04 08:30:58 -04:00
parent ce7ce2f6f1
commit 1902558826

View File

@ -16,8 +16,33 @@
let worker;
function test_xul() {
let lib;
isnot(null, OS.Constants.Path.libxul, "libxulpath is defined");
try {
lib = ctypes.open(OS.Constants.Path.libxul);
lib.declare("DumpJSStack", ctypes.default_abi, ctypes.void_t);
} catch (x) {
success = false;
ok(false, "Could not open libxul " + x);
}
if (lib) {
lib.close();
}
ok(true, "test_xul: opened libxul successfully");
}
function test() {
ok(true, "test_constants.xul: Starting test");
// Test 1: Load libxul from main thread
Components.classes["@mozilla.org/net/osfileconstantsservice;1"].
getService(Components.interfaces.nsIOSFileConstantsService).
init();
Components.utils.import("resource://gre/modules/ctypes.jsm");
test_xul();
// Test 2: Load libxul from chrome thread
worker = new ChromeWorker("worker_constants.js");
SimpleTest.waitForExplicitFinish();
ok(true, "test_constants.xul: Chrome worker created");