OLD | NEW |
1 function resetCookies() | 1 function resetCookies() |
2 { | 2 { |
3 if (window.testRunner) | 3 if (window.testRunner) |
4 testRunner.setAlwaysAcceptCookies(true); | 4 testRunner.setBlockThirdPartyCookies(false); |
5 | 5 |
6 // Due to cross-origin restrictions, we can only (simply) reset cookies for
our current origin. | 6 // Due to cross-origin restrictions, we can only (simply) reset cookies for
our current origin. |
7 var url = "http://" + window.location.hostname +":8000/cookies/resources/coo
kie-utility.php?queryfunction=deleteCookies"; | 7 var url = "http://" + window.location.hostname +":8000/cookies/resources/coo
kie-utility.php?queryfunction=deleteCookies"; |
8 var req = new XMLHttpRequest(); | 8 var req = new XMLHttpRequest(); |
9 try { | 9 try { |
10 req.open('GET', url, false); | 10 req.open('GET', url, false); |
11 req.send(); | 11 req.send(); |
12 } catch (e) { | 12 } catch (e) { |
13 alert("Attempt to clear " + url + " cookies might have failed. Test res
ults might be off from here on out. (" + e + ")"); | 13 alert("Attempt to clear " + url + " cookies might have failed. Test res
ults might be off from here on out. (" + e + ")"); |
14 } | 14 } |
15 | 15 |
16 if (window.testRunner) | 16 if (window.testRunner) |
17 testRunner.setAlwaysAcceptCookies(false); | 17 testRunner.setBlockThirdPartyCookies(true); |
18 } | 18 } |
OLD | NEW |