5 if (window
.testRunner
) {
6 testRunner
.clearBackForwardList();
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
13 document
.getElementById("logger").innerText
+= txt
+ "\n";
18 history
.pushState("StateStringData", "New title");
19 log("History length is " + history
.length
);
23 function statePopped()
25 log("State popped - " + event
.state
+ " (type " + typeof event
.state
+ ")");
26 if (event
.state
== null)
28 else if (window
.testRunner
)
29 testRunner
.notifyDone();
32 window
.onpopstate
= statePopped
;
35 <body onload=
"runTest();">
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
44 <pre id=
"logger"></pre>