diff --git a/js/xpconnect/tests/unit/test_allowedDomains.js b/js/xpconnect/tests/unit/test_allowedDomains.js index 163b2ca9a1e..a85d9d75a5d 100644 --- a/js/xpconnect/tests/unit/test_allowedDomains.js +++ b/js/xpconnect/tests/unit/test_allowedDomains.js @@ -41,6 +41,7 @@ function run_test() { evalAndCatch("objMaster.prop1", sbSubset); // Bug 777705: + sbMaster.Components = cu.getComponentsForScope(sbMaster); Components.utils.evalInSandbox("Components.interfaces", sbMaster); do_check_true(true); } diff --git a/js/xpconnect/tests/unit/test_components.js b/js/xpconnect/tests/unit/test_components.js index 72fdb13f4ab..5bd1b62bbb5 100644 --- a/js/xpconnect/tests/unit/test_components.js +++ b/js/xpconnect/tests/unit/test_components.js @@ -6,6 +6,11 @@ function run_test() { var sb4 = Cu.Sandbox("http://www.other.com"); var rv; + // Components is normally hidden from content on the XBL scope chain, but we + // expose it to content here to make sure that the security wrappers work + // regardless. + [sb1, sb2, sb4].forEach(function(x) { x.Components = Cu.getComponentsForScope(x); }); + // non-chrome accessing chrome Components sb1.C = Components; rv = Cu.evalInSandbox("C.utils", sb1); @@ -40,4 +45,4 @@ function run_test() { rv = Cu.evalInSandbox("C2.utils", sb1); do_check_eq(rv, undefined); -} \ No newline at end of file +}