| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> | 3 <meta http-equiv="x-ua-compatible" content="chrome=1" /> |
| 4 <title>FullTab mode cookie deletion test</title> | 4 <title>FullTab mode cookie deletion test</title> |
| 5 </head> | 5 </head> |
| 6 | 6 |
| 7 <script type="text/javascript" | 7 <script type="text/javascript" |
| 8 src="chrome_frame_tester_helpers.js"></script> | 8 src="chrome_frame_tester_helpers.js"></script> |
| 9 | 9 |
| 10 <script type="text/javascript"> | 10 <script type="text/javascript"> |
| 11 function onLoad() { | 11 function onLoad() { |
| 12 if (!isRunningInChrome()) { | 12 if (!isRunningInChrome()) { |
| 13 onFailure("FullTab_DeleteCookieTest", 1, "Not running in Chrome"); | 13 onFailure("FullTab_DeleteCookieTest", 1, "Not running in Chrome"); |
| 14 return; | 14 return; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // The path of the cookie in this test is set to "/." As a result it | 17 // The path of the cookie in this test is set to "/." so it should be |
| 18 // is set twice, once for the original URL and once for the | 18 // available for all files on the domain but should be set only once. |
| 19 // chrome_frame_tester_helpers.js script. We attempt to delete | |
| 20 // the cookie twice and validate that the end result is null. | |
| 21 // First validate that the document cookie contains the substring | 19 // First validate that the document cookie contains the substring |
| 22 // CF_FullTabDeleteCookie=1; CF_FullTabDeleteCookie=1 | 20 // "CF_FullTabDeleteCookie=1". |
| 23 // Then erase the first cookie and validate that it no longer contains | 21 // Then erase the first cookie and validate that it no longer contains |
| 24 // this string. | 22 // this string. |
| 25 var cookie_found = | 23 var original_cookies = document.cookie; |
| 26 /CF_FullTabDeleteCookie=1; CF_FullTabDeleteCookie=1/.test( | 24 var cookie_found = /CF_FullTabDeleteCookie=1/.test(document.cookie); |
| 27 document.cookie); | |
| 28 if (cookie_found) { | 25 if (cookie_found) { |
| 29 eraseCookie("CF_FullTabDeleteCookie"); | 26 eraseCookie("CF_FullTabDeleteCookie"); |
| 30 cookie_found = | 27 cookie_found = /CF_FullTabDeleteCookie=1/.test(document.cookie); |
| 31 /CF_FullTabDeleteCookie=1; CF_FullTabDeleteCookie=1/.test( | |
| 32 document.cookie); | |
| 33 if (!cookie_found) { | 28 if (!cookie_found) { |
| 34 onSuccess("FullTab_DeleteCookieTest", 1); | 29 onSuccess("FullTab_DeleteCookieTest", 1); |
| 35 } else { | 30 } else { |
| 36 onFailure("FullTab_DeleteCookieTest", 1, "Delete cookie failed"); | 31 onFailure("FullTab_DeleteCookieTest", 1, |
| 32 "CF_FullTabDeleteCookie still exists: " + original_cookies); |
| 37 } | 33 } |
| 38 } else { | 34 } else { |
| 39 onFailure("FullTab_DeleteCookieTest", 1, "Expected cookies not set"); | 35 onFailure("FullTab_DeleteCookieTest", 1, "Expected cookies not set"); |
| 40 } | 36 } |
| 41 } | 37 } |
| 42 </script> | 38 </script> |
| 43 | 39 |
| 44 <body onload="onLoad();"> | 40 <body onload="onLoad();"> |
| 45 This tests whether cookies get deleted correctly in full tab mode | 41 This tests whether cookies get deleted correctly in full tab mode |
| 46 </body> | 42 </body> |
| 47 </html> | 43 </html> |
| OLD | NEW |