tor-browser

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

test_pushState_after_document_open.html (1402B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=957479
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 957479</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script type="application/javascript">
     12 
     13  /** Test for Bug 957479 */
     14  SimpleTest.waitForExplicitFinish();
     15  // Child needs to invoke us, otherwise our onload will fire before the child
     16  // has done the write/close bit.
     17  onmessage = function doTest() {
     18    is(frames[0].location.pathname, "/tests/docshell/test/mochitest/file_pushState_after_document_open.html",
     19       "Should have the right path here");
     20    is(frames[0].location.hash, "", "Should have the right hash here");
     21    frames[0].history.pushState({}, "", frames[0].document.URL + "#foopy");
     22    is(frames[0].location.pathname, "/tests/docshell/test/mochitest/file_pushState_after_document_open.html",
     23       "Pathname should not have changed");
     24    is(frames[0].location.hash, "#foopy", "Hash should have changed");
     25    SimpleTest.finish();
     26  };
     27 
     28  </script>
     29 </head>
     30 <body>
     31 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=957479">Mozilla Bug 957479</a>
     32 <p id="display"></p>
     33 <div id="content" style="display: none">
     34 <iframe src="file_pushState_after_document_open.html"></iframe>
     35 </div>
     36 <pre id="test">
     37 </pre>
     38 </body>
     39 </html>