OLD | NEW |
1 <html> | 1 <html> |
2 <script src="resetCookies.js"></script> | 2 <script src="resetCookies.js"></script> |
3 <script> | 3 <script> |
4 resetCookies(); | 4 resetCookies(); |
5 | 5 |
6 if (window.testRunner) | 6 if (window.testRunner) |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
8 | 8 |
9 window.onmessage = function(evt) | 9 window.onmessage = function(evt) |
10 { | 10 { |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 var stage = 1; | 24 var stage = 1; |
25 function showCookies() | 25 function showCookies() |
26 { | 26 { |
27 alert("Test stage " + stage++ + " document.cookie is: " + document.cookie); | 27 alert("Test stage " + stage++ + " document.cookie is: " + document.cookie); |
28 parent.window.postMessage("done", "*"); | 28 parent.window.postMessage("done", "*"); |
29 } | 29 } |
30 | 30 |
31 function sendXHR(queryCommand) | 31 function sendXHR(queryCommand) |
32 { | 32 { |
| 33 if (window.testRunner) { |
| 34 // setAlwaysAcceptCookies() takes effect asynchronously (IPC is involved
). |
| 35 testRunner.setAlwaysAcceptCookies(true); |
| 36 } |
| 37 |
33 var baseurl = "http://localhost:8000/cookies/resources/cookie-utility.php"; | 38 var baseurl = "http://localhost:8000/cookies/resources/cookie-utility.php"; |
34 var url = queryCommand ? baseurl + "?queryfunction=" + queryCommand : baseur
l; | 39 var url = queryCommand ? baseurl + "?queryfunction=" + queryCommand : baseur
l; |
35 alert(url); | 40 alert(url); |
36 var req = new XMLHttpRequest(); | 41 var req = new XMLHttpRequest(); |
37 req.open('GET', url, false); | 42 req.open('GET', url, false); |
38 req.send(); | 43 req.send(); |
39 | 44 |
40 if (req.status == 200) | 45 if (req.status == 200) |
41 alert("XHR response - " + req.responseText); | 46 alert("XHR response - " + req.responseText); |
42 else | 47 else |
43 alert("xhr error"); | 48 alert("xhr error"); |
| 49 |
| 50 if (window.testRunner) { |
| 51 testRunner.setAlwaysAcceptCookies(false); |
| 52 } |
44 | 53 |
45 parent.window.postMessage("done", "*"); | 54 parent.window.postMessage("done", "*"); |
46 } | 55 } |
47 | 56 |
48 function resetCookiesAndNotifyDone() | 57 function resetCookiesAndNotifyDone() |
49 { | 58 { |
50 resetCookies(); | 59 resetCookies(); |
51 if (window.testRunner) | 60 if (window.testRunner) |
52 testRunner.notifyDone(); | 61 testRunner.notifyDone(); |
53 } | 62 } |
54 | 63 |
55 </script> | 64 </script> |
56 <body> | 65 <body> |
57 HELLO THERE | 66 HELLO THERE |
58 </body> | 67 </body> |
59 </html> | 68 </html> |
OLD | NEW |