about-blank-nested.https.html (1249B)
1 <!DOCTYPE html> 2 <head> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/cookies/resources/cookie-helper.sub.js"></script> 6 </head> 7 <body onload="doTests()"> 8 <iframe src="about:blank" id="if"> 9 </iframe> 10 <script> 11 function doTests() { 12 promise_test(async function(t) { 13 var child = document.getElementById("if"); 14 var grandKid = child.contentDocument.createElement("iframe"); 15 child.contentDocument.body.appendChild(grandKid); 16 var value = "" + Math.random(); 17 await resetSameSiteCookies(SECURE_ORIGIN, value); 18 19 // Using postToParent.py here to see cookies used when navigating the page. 20 grandKid.src = SECURE_ORIGIN + "/cookies/resources/postToParent.py" 21 var e = await wait_for_message("COOKIES", SECURE_ORIGIN); 22 assert_cookie(SECURE_ORIGIN, e.data, "samesite_unspecified", value, true); 23 assert_cookie(SECURE_ORIGIN, e.data, "samesite_lax", value, true); 24 assert_cookie(SECURE_ORIGIN, e.data, "samesite_strict", value, true); 25 assert_cookie(SECURE_ORIGIN, e.data, "samesite_none", value, true); 26 }, "SameSite cookies with intervening about:blank iframes and navigation"); 27 } 28 </script> 29 </body>