Backout a74bd5095902, Bug 959405 - Please update the Buri Moz-central, 1.3, 1.2 with...
[gecko.git] / docshell / test / test_pushState_after_document_open.html
blob51ba1050c21994a50cb7465f142764c7740b2fcc
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 type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
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/file_pushState_after_document_open.html", "Should have the right path here");
19 is(frames[0].location.hash, "", "Should have the right hash here");
20 frames[0].history.pushState({}, '', frames[0].document.URL + "#foopy");
21 is(frames[0].location.pathname, "/tests/docshell/test/file_pushState_after_document_open.html", "Pathname should not have changed");
22 is(frames[0].location.hash, "#foopy", "Hash should have changed");
23 SimpleTest.finish();
26 </script>
27 </head>
28 <body>
29 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=957479">Mozilla Bug 957479</a>
30 <p id="display"></p>
31 <div id="content" style="display: none">
32 <iframe src="file_pushState_after_document_open.html"></iframe>
33 </div>
34 <pre id="test">
35 </pre>
36 </body>
37 </html>