Backed out changeset 713114c0331a (bug 1938707) by developer request CLOSED TREE
[gecko.git] / js / xpconnect / tests / chrome / test_bug1041626.xhtml
blob61d763083806292221b7f911a72d56c418ecf920
1 <?xml version="1.0"?>
2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
4 <!--
5 https://bugzilla.mozilla.org/show_bug.cgi?id=1041626
6 -->
7 <window title="Mozilla Bug 1041626"
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=1041626"
14 target="_blank">Mozilla Bug 1041626</a>
15 </body>
17 <!-- test code goes here -->
18 <script type="application/javascript">
19 <![CDATA[
20 /** Test for Bug 1041626 **/
21 SimpleTest.waitForExplicitFinish();
22 function go() {
25 // Location
28 ok(Cu.isXrayWrapper(window[0].location), "Location is Xrayed");
29 let xrayOwnProperties = Object.getOwnPropertyNames(window[0].location);
31 let realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.location);
32 ok(realOwnProperties.length > 2);
34 is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
35 "Xray enumerates location properties properly");
38 // Document
41 ok(Cu.isXrayWrapper(window[0].document), "Document is Xrayed");
42 xrayOwnProperties = Object.getOwnPropertyNames(window[0].document);
44 realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.document);
45 ok(!!realOwnProperties.length);
47 is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
48 "Xray enumerates document properties properly");
52 SimpleTest.finish();
57 ]]>
58 </script>
59 <iframe onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
60 </window>