chrome/test/unit/test_bug292789.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/chrome/test/unit/test_bug292789.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 + */
     1.8 +
     1.9 +const MANIFESTS = [
    1.10 +  do_get_file("data/test_bug292789.manifest")
    1.11 +];
    1.12 +
    1.13 +registerManifests(MANIFESTS);
    1.14 +
    1.15 +var gIOS;
    1.16 +var gCR;
    1.17 +
    1.18 +function check_accessibility(spec, desired)
    1.19 +{
    1.20 +  var uri = gIOS.newURI(spec, null, null);
    1.21 +  var actual = gCR.allowContentToAccess(uri);
    1.22 +  do_check_eq(desired, actual);
    1.23 +}
    1.24 +
    1.25 +function run_test()
    1.26 +{
    1.27 +  gIOS = Cc["@mozilla.org/network/io-service;1"].
    1.28 +    getService(Ci.nsIIOService);
    1.29 +  gCR = Cc["@mozilla.org/chrome/chrome-registry;1"].
    1.30 +    getService(Ci.nsIXULChromeRegistry);
    1.31 +  gCR.checkForNewChrome();
    1.32 +
    1.33 +  check_accessibility("chrome://test1/content/", false);
    1.34 +  check_accessibility("chrome://test1/content/foo.js", false);
    1.35 +  check_accessibility("chrome://test2/content/", true);
    1.36 +  check_accessibility("chrome://test2/content/foo.js", true);
    1.37 +  check_accessibility("chrome://test3/content/", false);
    1.38 +  check_accessibility("chrome://test3/content/foo.js", false);
    1.39 +  check_accessibility("chrome://test4/content/", true);
    1.40 +}

mercurial