Bug 1922020, part 11 - Remove reliance on window.opener storage access heuristic in user.js from netwerk/ r=valentin,cookie-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D224816
This commit is contained in:
Benjamin VanderSloot 2024-10-31 18:36:31 +00:00
parent aa7ff404ee
commit 489ceeb75d
4 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,7 @@ support-files = [
["test_document_cookie.html"] ["test_document_cookie.html"]
["test_document_cookie_notification.html"] ["test_document_cookie_notification.html"]
scheme = "https"
["test_fetch.html"] ["test_fetch.html"]

View File

@ -5,7 +5,9 @@ function handleRequest(aRequest, aResponse) {
aResponse.setHeader( aResponse.setHeader(
"Set-Cookie", "Set-Cookie",
`${parts[0]}=foo; path=/; sameSite=none; secure; expires=${new Date( `${
parts[0]
}=foo; path=/; sameSite=none; secure; partitioned; expires=${new Date(
parseInt(parts[2], 10) parseInt(parts[2], 10)
).toGMTString()}`, ).toGMTString()}`,
false false

View File

@ -24,7 +24,7 @@ Listener.prototype = {
} }
const cl = new Listener(); const cl = new Listener();
document.cookie = "a=" + Math.random(); document.cookie = "a=" + Math.random() + "; Secure; Partitioned; SameSite=None";
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
</script> </script>

View File

@ -33,6 +33,12 @@ function setupTest(uri, cookies, loads) {
gExpectedCookies = cookies; gExpectedCookies = cookies;
gExpectedLoads = loads; gExpectedLoads = loads;
// If this is an xorigin test, the "oh=hai" cookie set by this frame
// in runTest() does not work because we are third-party
if (isXOrigin) {
gExpectedCookies -= 1;
}
// Listen for MessageEvents. // Listen for MessageEvents.
window.addEventListener("message", messageReceiver); window.addEventListener("message", messageReceiver);