Skip to content

Commit

Permalink
Expand web-platform-test coverage to include subdocument fetch creden…
Browse files Browse the repository at this point in the history
…tials

Some of the tests discussed in privacycg/storage-access#210

Differential Revision: https://phabricator.services.mozilla.com/D231720

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1936355
gecko-commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63
gecko-reviewers: anti-tracking-reviewers, timhuang
  • Loading branch information
bvandersloot-mozilla authored and moz-wptsync-bot committed Dec 11, 2024
1 parent 9fe5f14 commit 28d38b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

assert_true(await FrameHasStorageAccess(frame), "innermost frame has storage access after refresh.");
assert_true(await HasUnpartitionedCookie(frame), "innermost frame has access to cookies after refresh.");
let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_true(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has cookie in initial load");
}, "Same-site-initiated same-origin navigations preserve storage access");

promise_test(async (t) => {
Expand All @@ -59,7 +61,7 @@
assert_false(await FrameHasStorageAccess(frame), "innermost frame has no storage access after refresh.");
assert_false(await HasUnpartitionedCookie(frame), "innermost frame has no access to cookies after refresh.");
let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_false(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has cookie in initial load");
assert_false(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has no cookie in initial load");
}, "Same-site-initiated cross-origin navigations do not preserve storage access");

})();
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

assert_true(await FrameHasStorageAccess(frame), "frame has storage access after refresh.");
assert_true(await HasUnpartitionedCookie(frame), "frame has access to cookies after refresh.");

let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_true(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has cookie in initial load");
}, "Self-initiated reloads preserve storage access");

promise_test(async (t) => {
Expand All @@ -56,6 +59,8 @@

assert_true(await FrameHasStorageAccess(frame), "frame has storage access after refresh.");
assert_true(await HasUnpartitionedCookie(frame), "frame has access to cookies after refresh.");
let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_true(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has cookie in initial load");
}, "Self-initiated same-origin navigations preserve storage access");

promise_test(async (t) => {
Expand All @@ -71,6 +76,8 @@

assert_false(await FrameHasStorageAccess(frame), "frame does not have storage access after refresh.");
assert_false(await HasUnpartitionedCookie(frame), "frame has access to cookies after refresh.");
let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_false(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has no cookie in initial load");
}, "Non-self-initiated same-origin navigations do not preserve storage access");

promise_test(async (t) => {
Expand All @@ -83,5 +90,7 @@

assert_false(await FrameHasStorageAccess(frame), "frame does not have storage access after refresh.");
assert_false(await HasUnpartitionedCookie(frame), "frame has access to cookies after refresh.");
let cookieOnLoad = await GetHTTPCookiesFromFrame(frame);
assert_false(cookieStringHasCookie("cookie", "unpartitioned", cookieOnLoad), "innermost frame has no cookie in initial load");
}, "Self-initiated cross-origin navigations do not preserve storage access");
})();

0 comments on commit 28d38b4

Please sign in to comment.