tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug1041626.xhtml (1871B)


      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"/>
     10 
     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>
     16 
     17  <!-- test code goes here -->
     18  <script type="application/javascript">
     19  <![CDATA[
     20  /** Test for Bug 1041626 */
     21  SimpleTest.waitForExplicitFinish();
     22  function go() {
     23 
     24    //
     25    // Location
     26    //
     27 
     28    ok(Cu.isXrayWrapper(window[0].location), "Location is Xrayed");
     29    let xrayOwnProperties = Object.getOwnPropertyNames(window[0].location);
     30 
     31    let realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.location);
     32    ok(realOwnProperties.length > 2);
     33 
     34    is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
     35       "Xray enumerates location properties properly");
     36 
     37    //
     38    // Document
     39    //
     40 
     41    ok(Cu.isXrayWrapper(window[0].document), "Document is Xrayed");
     42    xrayOwnProperties = Object.getOwnPropertyNames(window[0].document);
     43 
     44    realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.document);
     45    ok(!!realOwnProperties.length);
     46 
     47    is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(),
     48       "Xray enumerates document properties properly");
     49 
     50 
     51 
     52    SimpleTest.finish();
     53  }
     54 
     55 
     56 
     57  ]]>
     58  </script>
     59  <iframe onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
     60 </window>