2 <?xml-stylesheet type=
"text/css" href=
"chrome://global/skin"?>
3 <?xml-stylesheet type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"?>
5 https://bugzilla.mozilla.org/show_bug.cgi?id=996069
7 <window title=
"Mozilla Bug 996069"
8 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <!-- test results are displayed in the html:body -->
12 <body xmlns=
"http://www.w3.org/1999/xhtml">
13 <a href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=996069"
14 target=
"_blank">Mozilla Bug
996069</a>
17 <!-- test code goes here -->
18 <script type=
"application/javascript">
20 /** Test for Bug
996069 **/
21 SimpleTest.waitForExplicitFinish();
24 var ifr = document.getElementById(
"ifr").contentWindow;
25 var sb = new Cu.Sandbox([ifr],
26 { sandboxPrototype: ifr });
28 ifr.wrappedJSObject.finishTest = function() {
29 // If we got here we did not hit the NS_ReleaseAssert...
30 ok(true,
"ExpandedPrincipal should not be inherited by content windows");
32 // But let's be sure that the new window does not have nsEP
33 newWin.wrappedJSObject.obj = Cu.evalInSandbox(
"var obj = { foo: 'bar' }; obj", sb);
35 newWin.eval(
"obj.foo");
36 ok(false,
"newWin should not have access to object from a scope with ExpandedPrincipal");
38 ok(/Permission denied/.exec(e.message),
"newWin should not have access to object from a scope with ExpandedPrincipal");
44 var newWin = Cu.evalInSandbox(
45 "window.open('https://example.org/chrome/js/xpconnect/tests/chrome/file_bug996069.html');",
51 <iframe id=
"ifr" onload=
"loaded();" type=
"content" src=
"https://example.org/chrome/js/xpconnect/tests/chrome/file_bug996069.html" />