Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / loader / stateobjects / popstate-after-load-complete-window-attribute.html
blob81267c7ca4c6ca40614ea9f64c095393a9ddeb73
1 <html>
2 <head>
3 <script>
5 if (window.testRunner) {
6 testRunner.clearBackForwardList();
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
11 function log(txt)
13 document.getElementById("logger").innerText += txt + "\n";
16 function runTest()
18 history.pushState("StateStringData", "New title");
19 log("History length is " + history.length);
20 history.back();
23 function statePopped()
25 log("State popped - " + event.state + " (type " + typeof event.state + ")");
26 if (event.state == null)
27 history.forward();
28 else if (window.testRunner)
29 testRunner.notifyDone();
32 window.onpopstate = statePopped;
34 </script>
35 <body onload="runTest();">
36 <pre>
37 This test does the following:
38 -Uses window.onpopstate to add a popstate handler
39 -Makes a call to pushState()
40 -Makes sure the history length is correct
41 -Goes back, and makes sure the popstate event is correct
42 -Goes forward, and makes sure the popstate event is correct
43 </pre><br>
44 <pre id="logger"></pre>
45 </body>
46 </html>