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=866823
7 <window title=
"Mozilla Bug 866823"
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=866823"
14 target=
"_blank">Mozilla Bug
866823</a>
17 <!-- test code goes here -->
18 <script type=
"application/javascript">
20 /** Test for Bug
866823 **/
21 SimpleTest.waitForExplicitFinish();
24 var iwin = $('ifr').contentWindow;
26 // Make sure that Xray waivers can't be transitively extended onto objects
27 // for whom the extender may not waive.
28 var sb = new Cu.Sandbox(iwin, { wantXrays: true });
30 ok(Cu.evalInSandbox('iwin.wrappedJSObject.top == iwin.top', sb),
"Waiver does not propagate");
31 Cu.evalInSandbox('iwin.wrappedJSObject.waiver = iwin.wrappedJSObject', sb);
32 ok(iwin.wrappedJSObject.eval('waiver == window'),
"Waivers disappear same-compartment");
34 // Make sure that standard prototypes don't get COWs.
35 sb.objProto = Object.prototype;
37 sb.eval('objProto.toString;', sb);
38 ok(false,
"Should have thrown");
40 ok(/denied|insecure/,
"No silent failure when accessing properties on forbidden prototype");
48 <iframe id=
"ifr" onload=
"go();" type=
"content" src=
"http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />