OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> | |
4 <title>FullTab mode set cookie test</title> | |
5 </head> | |
6 | |
7 <script type="text/javascript" | |
8 src="chrome_frame_tester_helpers.js"></script> | |
9 | |
10 <script type="text/javascript"> | |
11 function onLoad() { | |
12 if (!isRunningInChrome()) { | |
13 onFailure("FullTab_SetCookieTest", 1, "Not running in Chrome"); | |
14 return; | |
15 } | |
16 | |
17 // The path of the cookie in this test is set to "/." so it should be | |
18 // available for all files on the domain but should be set only once. | |
19 // First validate that the document cookie contains the substring | |
20 // "CF_FullTabDummyCookie=1". | |
21 // 1. Then create a cookie CF_FullTabSetCookie1=1 and verify it it got | |
22 // set correctly.. | |
23 // 2. Now create a second cookie CF_FullTabSetCookie2=1 and not validate | |
24 // whether both cookies can be found. | |
25 var original_cookies = document.cookie; | |
26 var cookie_found = /CF_FullTabDummyCookie=1/.test(document.cookie); | |
27 if (cookie_found) { | |
28 createCookie("CF_FullTabSetCookie1", 1, 1); | |
29 cookie_found = /CF_FullTabSetCookie1=1/.test(document.cookie); | |
30 if (!cookie_found) { | |
31 onFailure("FullTab_SetCookieTest", 1, "Failed to set first cookie"); | |
32 } else { | |
33 createCookie("CF_FullTabSetCookie2", 1, 1); | |
34 cookie_found = /CF_FullTabSetCookie2=1/.test(document.cookie); | |
35 if (!cookie_found) { | |
36 onFailure("FullTab_SetCookieTest", 1, | |
37 "Failed to find second cookie"); | |
38 } else { | |
39 cookie_found = /CF_FullTabSetCookie1=1/.test(document.cookie); | |
40 if (!cookie_found) { | |
41 onFailure("FullTab_SetCookieTest", 1, | |
42 "Failed to find first cookie"); | |
43 } | |
44 } | |
45 } | |
46 } else { | |
47 onFailure("FullTab_SetCookieTest", 1, "Expected cookies not set"); | |
48 } | |
49 | |
50 eraseCookie("CF_FullTabDummyCookie"); | |
51 eraseCookie("CF_FullTabSetCookie1"); | |
52 eraseCookie("CF_FullTabSetCookie2"); | |
53 | |
54 if (!readCookie("CF_FullTabDummyCookie") && | |
55 !readCookie("CF_FullTabSetCookie1") && | |
56 !readCookie("CF_FullTabSetCookie2")) { | |
57 onSuccess("FullTab_SetCookieTest", 1); | |
58 } else { | |
59 onFailure("FullTab_SetCookieTest", 1, "Failed to delete cookies"); | |
60 } | |
61 } | |
62 </script> | |
63 | |
64 <body onload="onLoad();"> | |
65 This tests whether cookies get set correctly in full tab mode | |
66 </body> | |
67 </html> | |
OLD | NEW |