2 // This script provides some mechanics for testing History
4 function onSuccess(name
, id
)
6 setTimeout(onFinished
, 0, name
, id
, "OK");
9 function onFailure(name
, id
, status
)
11 setTimeout(onFinished
, 0, name
, id
, status
);
14 // Finish running a test by setting the status
16 function onFinished(name
, id
, result
)
18 var statusPanel
= document
.getElementById("statusPanel");
20 statusPanel
.innerHTML
= result
;
24 document
.title
= "OK";
26 document
.title
= "FAIL";
29 function readCookie(name
) {
30 var cookie_name
= name
+ "=";
31 var ca
= document
.cookie
.split(';');
33 for(var i
= 0 ; i
< ca
.length
; i
++) {
35 while (c
.charAt(0) == ' ') {
36 c
= c
.substring(1,c
.length
);
38 if (c
.indexOf(cookie_name
) == 0) {
39 return c
.substring(cookie_name
.length
, c
.length
);
45 function createCookie(name
,value
,days
) {
48 var date
= new Date();
49 date
.setTime(date
.getTime() + (days
* 24 * 60 * 60 * 1000));
50 expires
= "; expires=" + date
.toGMTString();
52 document
.cookie
= name
+"="+value
+expires
+"; path=/";
55 function eraseCookie(name
) {
56 createCookie(name
, "", -1);
59 var navigate_backward_cookie
= "Navigate_Backward_Cookie";
60 var navigate_forward_cookie
= "Navigate_Forward_Cookie";