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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html

Issue 2409863002: Revert r414590 (Closed)
Patch Set: delete Created 4 years, 2 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <script src="/resources/testharness.js"></script> 2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script> 3 <script src="/resources/testharnessreport.js"></script>
4 <script src="/cookies/resources/testharness-helpers.js"></script> 4 <script src="/cookies/resources/testharness-helpers.js"></script>
5 <body>
6 <script> 5 <script>
7 // Set cookies on ORIGINAL_HOST, then move ourselves to TEST_ROOT so 6 // Set cookies on ORIGINAL_HOST, then move ourselves to TEST_ROOT so
8 // we can verify cross-origin behavior. 7 // we can verify cross-origin behavior.
9 if (window.location.hostname == "127.0.0.1") { 8 if (window.location.hostname == "127.0.0.1") {
10 window.location.hostname = ORIGINAL_HOST; 9 window.location.hostname = ORIGINAL_HOST;
11 } else if (window.location.hostname == ORIGINAL_HOST) { 10 } else if (window.location.hostname == ORIGINAL_HOST) {
12 clearKnownCookies(); 11 clearKnownCookies();
13 document.cookie = STRICT_DOM + "=1; SameSite=Strict; Max-Age=100; path=/"; 12 document.cookie = STRICT_DOM + "=1; SameSite=Strict; Max-Age=100; path=/";
14 document.cookie = LAX_DOM + "=1; SameSite=Lax; Max-Age=100; path=/"; 13 document.cookie = LAX_DOM + "=1; SameSite=Lax; Max-Age=100; path=/";
15 document.cookie = NORMAL_DOM + "=1; Max-Age=100; path=/"; 14 document.cookie = NORMAL_DOM + "=1; Max-Age=100; path=/";
16 window.location.hostname = TEST_HOST; 15 window.location.hostname = TEST_HOST;
17 } else { 16 } else {
18 async_test(t => { 17 async_test(t => {
19 window.addEventListener("message", t.step_func_done(e => { 18 window.addEventListener("message", t.step_func_done(e => {
20 assert_equals(e.data.http[STRICT_DOM], undefined, "strict"); 19 assert_equals(e.data.http[STRICT_DOM], undefined, "strict");
21 assert_equals(e.data.http[LAX_DOM], undefined, "lax"); 20 assert_equals(e.data.http[LAX_DOM], undefined, "lax");
22 assert_equals(e.data.http[NORMAL_DOM], "1", "normal"); 21 assert_equals(e.data.http[NORMAL_DOM], "1", "normal");
23 // TODO(mkwst): This should exclude the samesite cookies. 22 // TODO(mkwst): This should exclude the samesite cookies.
24 assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " + NORMAL_DOM + "=1"); 23 assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " + NORMAL_DOM + "=1");
25 e.source.close(); 24 e.source.close();
26 })); 25 }));
27 26
28 var f = document.createElement('form'); 27 var f = document.createElement('form');
29 f.action = "http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-coo kies-to-opener.php"; 28 f.action = "http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-coo kies-to-opener.php";
30 f.method = "POST"; 29 f.method = "POST";
31 f.target = "_blank" 30 f.target = "_blank"
32 window.onload = t.step_func(f.submit.bind(f)); 31 window.onload = t.step_func(f.submit.bind(f));
33 document.body.appendChild(f);
34 }, "'" + ORIGINAL_HOST + "' is not same-site with '" + TEST_HOST + "', so sa mesite cookies are not sent via POST."); 32 }, "'" + ORIGINAL_HOST + "' is not same-site with '" + TEST_HOST + "', so sa mesite cookies are not sent via POST.");
35 } 33 }
36 </script> 34 </script>
37 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698