| OLD | NEW |
| 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 <script> | 5 <script> |
| 6 async_test(t => { | 6 if (window.location.hostname == "127.0.0.1") { |
| 7 clearKnownCookies(); | 7 window.location.hostname = ORIGINAL_HOST; |
| 8 document.cookie = STRICT_DOM + "=1; SameSite=Strict; Max-Age=100; path=/"; | 8 } else if (window.location.hostname == ORIGINAL_HOST) { |
| 9 document.cookie = LAX_DOM + "=1; SameSite=Lax; Max-Age=100; path=/"; | 9 async_test(t => { |
| 10 document.cookie = NORMAL_DOM + "=1; Max-Age=100; path=/"; | 10 clearKnownCookies(); |
| 11 document.cookie = STRICT_DOM + "=1; SameSite=Strict; Max-Age=100; path=/
"; |
| 12 document.cookie = LAX_DOM + "=1; SameSite=Lax; Max-Age=100; path=/"; |
| 13 document.cookie = NORMAL_DOM + "=1; Max-Age=100; path=/"; |
| 11 | 14 |
| 12 window.addEventListener("message", t.step_func_done(e => { | 15 window.addEventListener("message", t.step_func_done(e => { |
| 13 assert_equals(e.data.http[STRICT_DOM], "1", "strict"); | 16 assert_equals(e.data.http[STRICT_DOM], "1", "strict"); |
| 14 assert_equals(e.data.http[LAX_DOM], "1", "lax"); | 17 assert_equals(e.data.http[LAX_DOM], "1", "lax"); |
| 15 assert_equals(e.data.http[NORMAL_DOM], "1", "normal"); | 18 assert_equals(e.data.http[NORMAL_DOM], "1", "normal"); |
| 16 assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " +
NORMAL_DOM + "=1"); | 19 assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1;
" + NORMAL_DOM + "=1"); |
| 17 e.source.close(); | 20 e.source.close(); |
| 18 })); | 21 })); |
| 19 | 22 |
| 20 var f = document.createElement('form'); | 23 var f = document.createElement('form'); |
| 21 f.action = "http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-cookies
-to-opener.php"; | 24 f.action = "http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-coo
kies-to-opener.php"; |
| 22 f.method = "POST"; | 25 f.method = "POST"; |
| 23 f.target = "_blank"; | 26 f.target = "_blank"; |
| 24 window.onload = t.step_func(f.submit.bind(f)); | 27 window.onload = t.step_func(f.submit.bind(f)); |
| 25 }, "'" + ORIGINAL_HOST + "' is same-site with itself, so samesite cookies are se
nt."); | 28 }, "'" + ORIGINAL_HOST + "' is same-site with itself, so samesite cookies ar
e sent."); |
| 29 } |
| 26 </script> | 30 </script> |
| OLD | NEW |