Skip to content

Commit

Permalink
Bug 1936355 - Expand web-platform-test coverage to include subdocumen…
Browse files Browse the repository at this point in the history
…t fetch credentials - r=anti-tracking-reviewers,timhuang

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

Differential Revision: https://phabricator.services.mozilla.com/D231720
  • Loading branch information
bvandersloot-mozilla committed Dec 11, 2024
1 parent 9a91d4e commit 5cf8fe5
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 5cf8fe5

Please sign in to comment.