test_bug292789.js (1043B)
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 */ 5 6 const MANIFESTS = [do_get_file("data/test_bug292789.manifest")]; 7 8 registerManifests(MANIFESTS); 9 10 var gCR; 11 12 function check_accessibility(spec, desired) { 13 var uri = Services.io.newURI(spec); 14 var actual = gCR.allowContentToAccess(uri); 15 Assert.equal(desired, actual); 16 } 17 18 function run_test() { 19 gCR = Cc["@mozilla.org/chrome/chrome-registry;1"].getService( 20 Ci.nsIXULChromeRegistry 21 ); 22 gCR.checkForNewChrome(); 23 24 check_accessibility("chrome://test1/content/", false); 25 check_accessibility("chrome://test1/content/foo.js", false); 26 check_accessibility("chrome://test2/content/", true); 27 check_accessibility("chrome://test2/content/foo.js", true); 28 check_accessibility("chrome://test3/content/", false); 29 check_accessibility("chrome://test3/content/foo.js", false); 30 check_accessibility("chrome://test4/content/", true); 31 }