sandbox-iframe-subresource.https.html (1165B)
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 id="if" sandbox="allow-scripts"> 9 </iframe> 10 <script> 11 function doTests() { 12 promise_test(async function(t) { 13 var value = "" + Math.random(); 14 await resetSameSiteCookies(SECURE_ORIGIN, value); 15 var child = document.getElementById("if"); 16 child.src = SECURE_ORIGIN + "/cookies/samesite/resources/iframe-subresource-report.html"; 17 18 // the iframe nested inside if should post COOKIES to here. 19 var e = await wait_for_message("COOKIES"); 20 // Not testing unspecified here as to not depend on the presence or 21 // absence of upcoming change of behavior. 22 assert_cookie(SECURE_ORIGIN, e.data, "samesite_lax", value, false); 23 assert_cookie(SECURE_ORIGIN, e.data, "samesite_strict", value, false); 24 assert_cookie(SECURE_ORIGIN, e.data, "samesite_none", value, true); 25 }, "SameSite cookies with intervening sandboxed iframe and subresources"); 26 } 27 </script> 28 </body>