4 https://bugzilla.mozilla.org/show_bug.cgi?id=1516237
8 <title>Test for Bug
1516237</title>
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://global/skin"/>
11 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css"/>
12 <script type=
"application/javascript">
14 /** Test for Bug
1516237 **/
16 SimpleTest.waitForExplicitFinish();
18 var frame = $('subframe');
21 // Get a CCW wrapping an Xray waiver wrapping a WindowProxy.
22 var w = frame.contentWindow;
23 var ccwToWaiver = w.wrappedJSObject;
24 ccwToWaiver.testProp =
1;
25 is(ccwToWaiver.testProp,
1,
"Can set properties on content window");
27 // Load a chrome page in the content frame. This might create a realm in
28 // the current chrome compartment - in that case we nuke the CCW to the
30 frame.onload = function() {
31 is(Cu.getClassName(w.Math, /* unwrap = */ false),
"Math",
32 "Window must be in same system compartment");
33 ok(Cu.isDeadWrapper(ccwToWaiver),
34 "Nuked CCW to same-compartment window");
37 frame.src =
"file_empty.html";
43 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1516237">Mozilla Bug
1516237</a>
45 <iframe id=
"subframe" src=
"http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" onload=
"go()"></iframe>