1 <html xmlns=
"http://www.w3.org/1999/xhtml">
2 <head><title>History Test Page
2</title>
3 <script type=
"text/javascript" src=
"HistoryHelper.js"></script>
6 <body onload=
"onLoad();">
7 <div id=
"statusPanel" style=
"border: 1px solid red; width: 100%">
8 History Test Page
2....
12 <script type=
"text/javascript">
15 // This page could be visited in the following sequences:-
16 // 1. history_length_test_page1->history_length_test_page2.html
17 // 2. history_length_test_page1->history_length_test_page2.html->
18 // redirect to history_length_test_page3.html
19 // ->history_length_test_page4.html->history_length_test_page3.html->
20 // history_length_test_page2.html->history_length_test_page1.html->
21 // history_length_test_page2.html
22 if (readCookie(navigate_forward_cookie
) != null) {
23 setTimeout(OnNavigateForward
, 0);
24 } else if (readCookie(navigate_backward_cookie
) != null) {
25 setTimeout(OnNavigateBackward
, 0);
27 setTimeout(OnInitialLoad
, 0);
32 function OnNavigateForward() {
33 if (window
.history
.length
!= 5) {
34 onFailure("History_Length_Test_2", 1,
35 "History length mismatch on initial load at page 2: " +
36 window
.history
.length
);
39 window
.history
.forward();
43 function OnNavigateBackward() {
44 if (window
.history
.length
!= 5) {
45 onFailure("History_Length_Test_2", 1,
46 "History length mismatch on initial load at page 2: " +
47 window
.history
.length
);
50 window
.history
.back();
54 function OnInitialLoad() {
55 if (window
.history
.length
!= 2 && window
.history
.length
!= 3) {
56 onFailure("History_Length_Test_2", 1,
57 "History length mismatch on initial load at page 2: " +
58 window
.history
.length
);
61 // Redirect to page 3.
62 window
.location
.href
= "history_length_test_page_3.html";