4 <script src=
"../../../resources/js-test.js"></script>
8 description("Check that PopStateEvent.state always has a correct value.");
10 window
.jsTestIsAsync
= true;
11 if (window
.testRunner
) {
12 testRunner
.clearBackForwardList();
13 testRunner
.waitUntilDone();
16 shouldBeDefined("history.state");
18 debug("Push state 1");
19 history
.pushState(1, "", "");
20 debug("Push state 2");
21 history
.pushState(2, "", "");
22 shouldEvaluateTo("history.state", 2);
25 window
.onpopstate = function(e
) {
27 shouldEvaluateTo("popStateEvent.state", 1);
28 shouldEvaluateTo("history.state", 1);
30 debug("Push state 3");
31 history
.pushState(3, "", "");
32 shouldEvaluateTo("popStateEvent.state", 1);
33 shouldEvaluateTo("history.state", 3);
35 setTimeout(finishJSTest
, 0);
39 window
.onload = function() {