test_bug1041626.xul 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  10. <!-- test results are displayed in the html:body -->
  11. <body xmlns="http://www.w3.org/1999/xhtml">
  12. <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1041626"
  13. target="_blank">Mozilla Bug 1041626</a>
  14. </body>
  15. <!-- test code goes here -->
  16. <script type="application/javascript">
  17. <![CDATA[
  18. /** Test for Bug 1041626 **/
  19. SimpleTest.waitForExplicitFinish();
  20. const Cu = Components.utils;
  21. function go() {
  22. //
  23. // Location
  24. //
  25. ok(Cu.isXrayWrapper(window[0].location), "Location is Xrayed");
  26. let xrayOwnProperties = Object.getOwnPropertyNames(window[0].location);
  27. let realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.location);
  28. ok(realOwnProperties.length > 2);
  29. is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
  30. "Xray enumerates location properties properly");
  31. //
  32. // Document
  33. //
  34. ok(Cu.isXrayWrapper(window[0].document), "Document is Xrayed");
  35. xrayOwnProperties = Object.getOwnPropertyNames(window[0].document);
  36. realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.document);
  37. ok(realOwnProperties.length > 0);
  38. is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
  39. "Xray enumerates document properties properly");
  40. SimpleTest.finish();
  41. }
  42. ]]>
  43. </script>
  44. <iframe onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
  45. </window>