Bug 1786084 [wpt PR 35538] - Fix bad assertion in css/css-typed-om/stylevalue-normali...
[gecko.git] / chrome / test / unit / test_bug399707.js
blob427a0fbc9958bdf90ab591d4f87fd0681d8e4570
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/.
4  */
6 var MANIFESTS = [do_get_file("data/test_bug399707.manifest")];
8 registerManifests(MANIFESTS);
10 const { updateAppInfo } = ChromeUtils.import(
11   "resource://testing-common/AppInfo.jsm"
13 updateAppInfo({
14   name: "XPCShell",
15   ID: "{39885e5f-f6b4-4e2a-87e5-6259ecf79011}",
16   version: "5",
17   platformVersion: "1.9",
18 });
20 var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
21   Ci.nsIChromeRegistry
23 chromeReg.checkForNewChrome();
25 var target = Services.io.newFileURI(do_get_file("data"));
26 target = target.spec + "test/test.xul";
28 function test_succeeded_mapping(namespace) {
29   var uri = Services.io.newURI("chrome://" + namespace + "/content/test.xul");
30   try {
31     var result = chromeReg.convertChromeURL(uri);
32     Assert.equal(result.spec, target);
33   } catch (ex) {
34     do_throw(namespace);
35   }
38 function test_failed_mapping(namespace) {
39   var uri = Services.io.newURI("chrome://" + namespace + "/content/test.xul");
40   try {
41     chromeReg.convertChromeURL(uri);
42     do_throw(namespace);
43   } catch (ex) {}
46 function run_test() {
47   test_succeeded_mapping("test1");
48   test_succeeded_mapping("test2");
49   test_succeeded_mapping("test3");
50   test_failed_mapping("test4");
51   test_failed_mapping("test5");
52   test_failed_mapping("test6");
53   test_failed_mapping("test7");
54   test_failed_mapping("test8");