7cbeb8dde52b853e890b177979059510a53887bd
[WebKit-https.git] / LayoutTests / fast / loader / stateobjects / popstate-is-asynchronous.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <link rel="stylesheet" href="../../../resources/js-test-style.css" type="text/css">
5 <script src="../../../resources/js-test-pre.js"></script>
6 <div id="description"></div>
7 <pre id="console"></pre>
8 <script>
9 description('Tests that popstate events fire asynchronously.');
10
11 window.onload = function()
12 {
13     debug('onload fired');
14     history.pushState("test", "test");
15     history.back();
16 }
17
18 var initialPopState = true;
19
20 window.onpopstate = function()
21 {
22     debug('popstate fired');
23
24     if (initialPopState) {
25         initialPopState = false;
26
27         // This should not be re-entrant; there should be no other log lines
28         // between the "Setting..." and "Set..." lines.
29         debug('Setting hash to #foo');
30         location.hash = '#foo';
31         debug('Set hash to #foo');
32     } else
33         finishJSTest();
34 }
35
36 var successfullyParsed = true;
37 var jsTestIsAsync = true;
38 </script>
39 <script src="../../../resources/js-test-post.js"></script>
40 </html>