Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / js / xpconnect / tests / chrome / test_bug1516237.html
blob5c640c20524b37d2a39f9968ac1425e4bbe5c946
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1516237
5 -->
6 <head>
7 <meta charset="utf-8">
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 **/
15 function go() {
16 SimpleTest.waitForExplicitFinish();
18 var frame = $('subframe');
19 frame.onload = null;
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
29 // waiver.
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");
35 SimpleTest.finish();
37 frame.src = "file_empty.html";
40 </script>
41 </head>
42 <body>
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>
47 </body>
48 </html>