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
);
20 history
.replaceState(1, "Replaced title");
21 log("History length is " + history
.length
);
25 onpopstate = function(event
)
27 log("State popped - " + event
.state
+ " (type " + typeof event
.state
+ ")");
28 if (event
.state
== null)
30 else if (window
.testRunner
)
31 testRunner
.notifyDone();
35 <body onload=
"runTest();">
37 This test does the following:
38 -Makes a call to pushState()
39 -Makes sure the history length is correct
40 -Makes a call to replaceState()
41 -Makes sure the history length is correct
42 -Goes back, and makes sure the popstate event is correct
43 -Goes forward, and makes sure the popstate event represents the replaced state object
45 <pre id=
"logger"></pre>