62cbc38e2b19b604991b96b6d4bc6a1c7f055060
[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 shouldNotHaveCookie("implicit-strict");
19     await shouldNotHaveCookie("strict-because-invalid-SameSite-value");
20     await shouldNotHaveCookie("lax");
21
22     debug("<br>Cookies visible in DOM:");
23     shouldNotHaveDOMCookie("strict");
24     shouldNotHaveDOMCookie("implicit-strict");
25     shouldNotHaveDOMCookie("strict-because-invalid-SameSite-value");
26     shouldNotHaveDOMCookie("lax");
27
28     await resetCookies();
29     finishJSTest();
30 }
31
32 checkResult();
33 </script>
34 </body>
35 </html>