1 <html xmlns=
"http://www.w3.org/1999/xhtml">
2 <head><title>History Test Page
3</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
3....
12 <script type=
"text/javascript">
15 if (readCookie(navigate_forward_cookie
) != null) {
16 setTimeout(OnNavigateForward
, 0);
19 if (readCookie(navigate_backward_cookie
) != null) {
20 setTimeout(OnNavigateBackward
, 0);
23 setTimeout(OnInitialLoad
, 0);
27 function OnInitialLoad() {
28 // This page could be visited in the following sequences:-
29 // 1. history_length_test_page2.html redirect to
30 // history_length_test_page3.html
31 // 1. history_length_test_page1.html -> history_length_test_page2.html
32 // redirects to history_length_page3.html.
33 // This history lengths could be 3 or 5.
34 if (window
.history
.length
!= 3 && window
.history
.length
!= 4) {
35 onFailure("History_Length_Test_2", 1,
36 "History length mismatch on initial load at page 3: " +
37 window
.history
.length
);
40 onSuccess("History_Length_Test_2", 1);
44 function OnNavigateBackward() {
45 if (window
.history
.length
!= 5) {
46 onFailure("History_Length_Test_3", 1,
47 "History length mismatch on navigating backward at page 3: " +
48 window
.history
.length
);
51 window
.history
.back();
55 function OnNavigateForward() {
56 if (window
.history
.length
!= 5) {
57 onFailure("History_Length_Test_3", 1,
58 "History length mismatch on navigating forward at page 3: " +
59 window
.history
.length
);
62 window
.history
.forward();