4 https://bugzilla.mozilla.org/show_bug.cgi?id=615501
7 <title>Test for Bug
615501</title>
8 <script type=
"application/javascript" src=
"/MochiKit/packed.js"></script>
9 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=615501">Mozilla Bug
615501</a>
15 <iframe id='iframe' src='file_bug615501.html'
></iframe>
17 <script type=
"application/javascript;version=1.7">
19 /** Test for Bug
615501 **/
21 SimpleTest.waitForExplicitFinish();
23 // Called by inner frame on DOMContentLoaded.
24 function innerDOMContentLoaded() {
27 // Called by inner frame on load.
28 function innerLoad() {
31 // Called by inner frame on popstate.
33 function innerPopstate(e) {
36 if (numPopstates ==
1) {
37 // This is the inner frame's initial popstate. Spin the event loop, then
39 ok(true, 'Got initial popstate.');
40 is(e.initial, true, 'Initial popstate should have .initial set to true.');
41 setTimeout(runTest,
0);
44 is(e.initial, false, 'State-change popstate should have .initial set to false.');
45 is(e.state, '
1', 'Correct state after back.');
51 var win = $('iframe').contentWindow;
52 win.history.replaceState('
1', '
1', '
1');
53 win.history.pushState('
2', '
2', '
2');
56 // If back() is synchronous, this replaceState call won't cause us to cancel
57 // the popstate from the call to back.
58 win.history.replaceState('a', 'a', 'a');