test_bug292789.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. const MANIFESTS = [
  6. do_get_file("data/test_bug292789.manifest")
  7. ];
  8. registerManifests(MANIFESTS);
  9. var gIOS;
  10. var gCR;
  11. function check_accessibility(spec, desired)
  12. {
  13. var uri = gIOS.newURI(spec, null, null);
  14. var actual = gCR.allowContentToAccess(uri);
  15. do_check_eq(desired, actual);
  16. }
  17. function run_test()
  18. {
  19. gIOS = Cc["@mozilla.org/network/io-service;1"].
  20. getService(Ci.nsIIOService);
  21. gCR = Cc["@mozilla.org/chrome/chrome-registry;1"].
  22. getService(Ci.nsIXULChromeRegistry);
  23. gCR.checkForNewChrome();
  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. }