Update SameSite tests for new semantics for empty and invalid SameSite attribute
[WebKit-https.git] / LayoutTests / http / tests / cookies / same-site / resources / fetch-after-navigating-iframe-in-cross-origin-page.php
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 <script src="../../resources/cookie-utilities.js"></script>
6 <script>_setCachedCookiesJSON('<?php echo json_encode($_COOKIE); ?>')</script>
7 </head>
8 <body>
9 <script>
10 window.jsTestIsAsync = true;
11
12 description("Tests that Same-Site cookies for 127.0.0.1 are not sent with a frame navigation for a frame embedded in a page with a different origin.");
13
14 async function checkResult()
15 {
16     debug("Cookies sent with HTTP request:");
17     await shouldNotHaveCookie("strict");
18     await shouldHaveCookieWithValue("implicit-strict", "6");
19     await shouldHaveCookieWithValue("strict-because-invalid-SameSite-value", "6");
20     await shouldNotHaveCookie("lax");
21
22     debug("<br>Cookies visible in DOM:");
23     shouldNotHaveDOMCookie("strict");
24     shouldHaveDOMCookieWithValue("implicit-strict", "6");
25     shouldHaveDOMCookieWithValue("strict-because-invalid-SameSite-value", "6");
26     shouldNotHaveDOMCookie("lax");
27
28     await resetCookies();
29     finishJSTest();
30 }
31
32 checkResult();
33 </script>
34 </body>
35 </html>