Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<meta charset="utf-8">
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/partitioned-popins/resources/cookie-helpers.js"></script>
<script>
(async function() {
test_driver.set_test_context(window.top.opener);
// Step 9 (partitioned-popins/partitioned-popins.cookies-*.tentative.sub.https.window.js)
const id = (new URLSearchParams(window.location.search)).get("id");
document.cookie = "ThirdPartyStrict=" + id + "; Partitioned; SameSite=Strict; Secure";
document.cookie = "ThirdPartyLax=" + id + "; Partitioned; SameSite=Lax; Secure";
document.cookie = "ThirdPartyNone=" + id + "; Partitioned; SameSite=None; Secure";
let message = ",ReadInPopinIframe:";
message += getCookieMessage(document.cookie, "FirstParty", "", id);
message += getCookieMessage(document.cookie, "ThirdParty", "", id);
await test_driver.set_permission({ name: 'storage-access' }, 'granted');
await test_driver.bless("fake user interaction", () => document.requestStorageAccess());
document.cookie = "FirstPartyStrictAfterRSA=" + id + "; SameSite=Strict; Secure";
document.cookie = "FirstPartyLaxAfterRSA=" + id + "; SameSite=Lax; Secure";
document.cookie = "FirstPartyNoneAfterRSA=" + id + "; SameSite=None; Secure";
document.cookie = "ThirdPartyStrictAfterRSA=" + id + "; Partitioned; SameSite=Strict; Secure";
document.cookie = "ThirdPartyLaxAfterRSA=" + id + "; Partitioned; SameSite=Lax; Secure";
document.cookie = "ThirdPartyNoneAfterRSA=" + id + "; Partitioned; SameSite=None; Secure";
message += ",ReadInPopinIframeAfterRSA:";
message += getCookieMessage(document.cookie, "FirstParty", "", id);
message += getCookieMessage(document.cookie, "ThirdParty", "", id);
message += getCookieMessage(document.cookie, "FirstParty", "AfterRSA", id);
message += getCookieMessage(document.cookie, "ThirdParty", "AfterRSA", id);
window.top.postMessage({type: "popin-iframe-read", message: message}, "*");
})();
</script>