michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: const MANIFESTS = [ michael@0: do_get_file("data/test_bug292789.manifest") michael@0: ]; michael@0: michael@0: registerManifests(MANIFESTS); michael@0: michael@0: var gIOS; michael@0: var gCR; michael@0: michael@0: function check_accessibility(spec, desired) michael@0: { michael@0: var uri = gIOS.newURI(spec, null, null); michael@0: var actual = gCR.allowContentToAccess(uri); michael@0: do_check_eq(desired, actual); michael@0: } michael@0: michael@0: function run_test() michael@0: { michael@0: gIOS = Cc["@mozilla.org/network/io-service;1"]. michael@0: getService(Ci.nsIIOService); michael@0: gCR = Cc["@mozilla.org/chrome/chrome-registry;1"]. michael@0: getService(Ci.nsIXULChromeRegistry); michael@0: gCR.checkForNewChrome(); michael@0: michael@0: check_accessibility("chrome://test1/content/", false); michael@0: check_accessibility("chrome://test1/content/foo.js", false); michael@0: check_accessibility("chrome://test2/content/", true); michael@0: check_accessibility("chrome://test2/content/foo.js", true); michael@0: check_accessibility("chrome://test3/content/", false); michael@0: check_accessibility("chrome://test3/content/foo.js", false); michael@0: check_accessibility("chrome://test4/content/", true); michael@0: }