1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 do_get_file("data/test_bug397073.manifest")
11 registerManifests(MANIFESTS);
16 ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
18 appBuildID: "2007010101",
19 platformVersion: "1.9",
20 platformBuildID: "2007010101",
22 logConsoleErrors: true,
24 XPCOMABI: "noarch-spidermonkey",
26 QueryInterface: function QueryInterface(iid) {
27 if (iid.equals(Ci.nsIXULAppInfo)
28 || iid.equals(Ci.nsIXULRuntime)
29 || iid.equals(Ci.nsISupports))
32 throw Components.results.NS_ERROR_NO_INTERFACE;
36 var XULAppInfoFactory = {
37 createInstance: function (outer, iid) {
39 throw Components.results.NS_ERROR_NO_AGGREGATION;
40 return XULAppInfo.QueryInterface(iid);
43 var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
44 registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
45 XULAPPINFO_CONTRACTID, XULAppInfoFactory);
47 var gIOS = Cc["@mozilla.org/network/io-service;1"]
48 .getService(Ci.nsIIOService);
49 var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
50 .getService(Ci.nsIChromeRegistry);
51 chromeReg.checkForNewChrome();
53 var target = gIOS.newFileURI(do_get_file("data"));
54 target = target.spec + "test/test.xul";
56 function test_succeeded_mapping(namespace)
58 var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul",
61 var result = chromeReg.convertChromeURL(uri);
62 do_check_eq(result.spec, target);
69 function test_failed_mapping(namespace)
71 var uri = gIOS.newURI("chrome://" + namespace + "/content/test.xul",
74 var result = chromeReg.convertChromeURL(uri);
83 test_succeeded_mapping("test1");
84 test_succeeded_mapping("test2");
86 test_failed_mapping("test3");