michael@0: const XULAppInfo = { michael@0: vendor: "Mozilla", michael@0: name: "XPCShell", michael@0: ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}", michael@0: version: "5", michael@0: appBuildID: "2007010101", michael@0: platformVersion: "1.9", michael@0: platformBuildID: "2007010101", michael@0: inSafeMode: false, michael@0: logConsoleErrors: true, michael@0: OS: "XPCShell", michael@0: XPCOMABI: "noarch-spidermonkey", michael@0: michael@0: QueryInterface: function QueryInterface(iid) { michael@0: if (iid.equals(Ci.nsIXULAppInfo) michael@0: || iid.equals(Ci.nsIXULRuntime) michael@0: || iid.equals(Ci.nsISupports)) michael@0: return this; michael@0: michael@0: throw Components.results.NS_ERROR_NO_INTERFACE; michael@0: } michael@0: }; michael@0: michael@0: const XULAppInfoFactory = { michael@0: // These two are used when we register all our factories (and unregister) michael@0: CID: XULAPPINFO_CID, michael@0: scheme: "XULAppInfo", michael@0: contractID: XULAPPINFO_CONTRACTID, michael@0: createInstance: function (outer, iid) { michael@0: if (outer != null) michael@0: throw Cr.NS_ERROR_NO_AGGREGATION; michael@0: return XULAppInfo.QueryInterface(iid); michael@0: } michael@0: }; michael@0: michael@0: var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); michael@0: registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo", michael@0: XULAPPINFO_CONTRACTID, XULAppInfoFactory); michael@0: michael@0: registerManifests([do_get_file("data/test_abi.manifest")]); michael@0: michael@0: const catman = Components.classes["@mozilla.org/categorymanager;1"]. michael@0: getService(Components.interfaces.nsICategoryManager); michael@0: michael@0: function is_registered(name) { michael@0: try { michael@0: var d = catman.getCategoryEntry("abitest", name); michael@0: return d == "found"; michael@0: } michael@0: catch (e) { michael@0: return false; michael@0: } michael@0: } michael@0: michael@0: function run_test() { michael@0: do_check_true(is_registered("test1")); michael@0: do_check_false(is_registered("test2")); michael@0: do_check_true(is_registered("test3")); michael@0: do_check_false(is_registered("test4")); michael@0: }