Revert to dispatching the popstate event synchronously
[WebKit-https.git] / LayoutTests / fast / loader / stateobjects / popstate-is-synchronous.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 synchronously during fragment navigation.');
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         window.setTimeout(finishJSTest, 0);
26         return;
27     }
28
29     initialPopState = false;
30
31     debug('Setting hash to #foo');
32     location.hash = '#foo';
33     debug('Set hash to #foo');
34 }
35
36 var successfullyParsed = true;
37 var jsTestIsAsync = true;
38 </script>
39 <script src="../../../resources/js-test-post.js"></script>
40 </html>