5 if (window
.testRunner
) {
6 testRunner
.clearBackForwardList();
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
13 document
.getElementById("logger").innerText
+= txt
+ "\n";
18 history
.replaceState("OriginalHistoryItem", "Replaced title");
19 log("History length is " + history
.length
);
20 history
.pushState("NewHistoryItem", "Pushed 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
== "OriginalHistoryItem")
30 else if (window
.testRunner
)
31 testRunner
.notifyDone();
35 <body onload=
"runTest();">
37 This test does the following:
38 -Makes a call to replaceState()
39 -Makes sure the history length is correct
40 -Makes a call to pushState()
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 is correct
45 <pre id=
"logger"></pre>