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=706301
7 <window title=
"Mozilla Bug 706301"
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=706301"
14 target=
"_blank">Mozilla Bug
706301</a>
15 <iframe id=
"ifr" src=
"http://mochi.test:8888/tests/js/xpconnect/tests/mochitest/file_bug706301.html" onload=
"doTest();" />
18 <!-- test code goes here -->
19 <script type=
"application/javascript">
21 /** Test for Bug
706301 **/
23 SimpleTest.waitForExplicitFinish();
25 function getLengthInChrome(nodelist) {
27 // Make sure the object is Xray wrapped.
28 is(nodelist, Cu.unwaiveXrays(nodelist),
29 "object passed from content to chrome should be Xray-wrapped.");
31 // Perform the operation.
32 Object.getOwnPropertyDescriptor(nodelist, 'length');
33 return !nodelist.length;
36 function finishTestInChrome() {
42 // Set up the callbacks for content.
43 $('ifr').contentWindow.wrappedJSObject.getLengthInChrome = getLengthInChrome;
44 $('ifr').contentWindow.wrappedJSObject.finishTestInChrome = finishTestInChrome;
45 $('ifr').contentWindow.wrappedJSObject.ok = ok;
48 $('ifr').contentWindow.postMessage({}, '*');