3 if (location.search.substring(1).length == 0) {
4 sessionStorage.testStage = 0;
5 if (window.layoutTestController) {
6 layoutTestController.dumpAsText();
7 layoutTestController.clearBackForwardList();
8 layoutTestController.waitUntilDone();
12 // Location changes need to happen outside the onload handler to generate history entries.
13 setTimeout(function() {
14 // This test advances history by 2 pages, then navigates back one, and
15 // records history.length. We expect history.length to indicate the total
16 // length of session history. At the end of the test, it should be 2 greater
17 // than it was at the start of the test.
18 switch (sessionStorage.testStage++) {
20 sessionStorage.initialLength = history.length;
30 if (history.length == (sessionStorage.initialLength - 0) + 2)
31 document.body.innerHTML = "PASS";
33 document.body.innerHTML = "FAIL: initialLength=" + sessionStorage.initialLength + ", history.length=" + history.length;
34 if (window.layoutTestController)
35 layoutTestController.notifyDone();
40 onunload = function() {