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