Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/cookies/resources/third-party-cookie-relaxing-iframe.html

Issue 2878663002: s/setAlwaysAcceptCookies/setBlockThirdPartyCookies/ in third-party-cookie-relaxing-iframe.html (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 {
11 if (evt.data == "showCookies") { 11 if (evt.data == "showCookies") {
12 showCookies(); 12 showCookies();
13 return; 13 return;
14 } else if (evt.data.split(" ")[0] == "sendXHR") { 14 } else if (evt.data.split(" ")[0] == "sendXHR") {
15 sendXHR(evt.data.split(" ")[1]); 15 sendXHR(evt.data.split(" ")[1]);
16 return; 16 return;
17 } else if (evt.data == "resetCookiesAndNotifyDone") { 17 } else if (evt.data == "resetCookiesAndNotifyDone") {
18 resetCookiesAndNotifyDone(); 18 resetCookiesAndNotifyDone();
19 return; 19 return;
20 } else 20 } else
21 alert("Unknown message."); 21 alert("Unknown message.");
22 } 22 }
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) { 33 if (window.testRunner) {
34 // setAlwaysAcceptCookies() takes effect asynchronously (IPC is involved ). 34 // setBlockThirdPartyCookies() takes effect asynchronously (IPC is invol ved).
35 testRunner.setBlockThirdPartyCookies(false); 35 testRunner.setBlockThirdPartyCookies(false);
36 } 36 }
37 37
38 var baseurl = "http://localhost:8000/cookies/resources/cookie-utility.php"; 38 var baseurl = "http://localhost:8000/cookies/resources/cookie-utility.php";
39 var url = queryCommand ? baseurl + "?queryfunction=" + queryCommand : baseur l; 39 var url = queryCommand ? baseurl + "?queryfunction=" + queryCommand : baseur l;
40 alert(url); 40 alert(url);
41 var req = new XMLHttpRequest(); 41 var req = new XMLHttpRequest();
42 req.open('GET', url, false); 42 req.open('GET', url, false);
43 req.send(); 43 req.send();
44 44
45 if (req.status == 200) 45 if (req.status == 200)
46 alert("XHR response - " + req.responseText); 46 alert("XHR response - " + req.responseText);
47 else 47 else
48 alert("xhr error"); 48 alert("xhr error");
49 49
50 if (window.testRunner) { 50 if (window.testRunner) {
51 testRunner.setBlockThirdPartyCookies(true); 51 testRunner.setBlockThirdPartyCookies(true);
52 } 52 }
53 53
54 parent.window.postMessage("done", "*"); 54 parent.window.postMessage("done", "*");
55 } 55 }
56 56
57 function resetCookiesAndNotifyDone() 57 function resetCookiesAndNotifyDone()
58 { 58 {
59 resetCookies(); 59 resetCookies();
60 if (window.testRunner) 60 if (window.testRunner)
61 testRunner.notifyDone(); 61 testRunner.notifyDone();
62 } 62 }
63 63
64 </script> 64 </script>
65 <body> 65 <body>
66 HELLO THERE 66 HELLO THERE
67 </body> 67 </body>
68 </html> 68 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698