commit 14602a04b8230e6776e6dfcc34c88d25cd778c5a
parent 3efdcde8226573ba50284befbe6b67b6f514be24
Author: Joshua Hood <jdh@chromium.org>
Date: Wed, 19 Nov 2025 04:55:33 +0000
Bug 2000695 [wpt PR 56067] - Silently exit BTM WPTs when third-party cookies are not blocked, a=testonly
Automatic update from web-platform-tests
Silently exit BTM WPTs when third-party cookies are not blocked
This CL re-enables the WPTs for BTM and updates them to silently exit on
platforms where 3rd party cookies are not blocked by default.
Bug: 446172590
Change-Id: Id1955c48b1526f44dec03c5d95ef7be7dcf60f74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7156018
Reviewed-by: Fiona Macintosh <fmacintosh@google.com>
Commit-Queue: Joshua Hood <jdh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1546080}
--
wpt-commits: 1be792eceead75c49873a0931fc1d96fa60725a5
wpt-pr: 56067
Diffstat:
2 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/testing/web-platform/tests/nav-tracking-mitigations/stateful-client-bounce.sub.https.html b/testing/web-platform/tests/nav-tracking-mitigations/stateful-client-bounce.sub.https.html
@@ -6,18 +6,35 @@
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
+<script src=/cookies/resources/cookie-helper.sub.js></script>
+<script src=/storage-access-api/helpers.js></script>
<script>
- promise_setup(async () => {
- try {
- await test_driver.set_storage_access('*', '*', 'blocked');
- } catch (e) {
- // Ignore, can be unimplemented if the platform blocks cross-site
- // cookies by default. If this failed without default blocking the test
- // will fail.
- }
- });
+ async function CheckCrossSiteCookieAccess(t) {
+ const altOrigin = "https://{{hosts[alt][]}}:{{ports[https][0]}}";
+ const altPath = "/storage-access-api/resources/script-with-cookie-header.py?script=embedded_responder.js";
+ const url = `${altOrigin}${altPath}`;
+
+ await SetFirstPartyCookie(altOrigin);
+ t.add_cleanup(async () => {
+ await test_driver.delete_all_cookies();
+ await MaybeSetStorageAccess("*", "*", "allowed");
+ });
+
+ const frame = await CreateFrame(url);
+ const hasCookieAccess = await HasUnpartitionedCookie(frame);
+
+ return hasCookieAccess;
+ }
promise_test(async t => {
+ await MaybeSetStorageAccess("*", "*", "blocked");
+
+ if (await CheckCrossSiteCookieAccess(t)) {
+ // Nothing to test here, as cross-site cookies are not blocked.
+ // See https://github.com/privacycg/storage-access/issues/162.
+ return;
+ }
+
let linkInNewPage = null;
// Open a new tab and retrieve the link to start the test.
diff --git a/testing/web-platform/tests/nav-tracking-mitigations/stateless-client-bounce.sub.https.html b/testing/web-platform/tests/nav-tracking-mitigations/stateless-client-bounce.sub.https.html
@@ -6,18 +6,35 @@
<script src=/resources/testharnessreport.js></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
+<script src=/cookies/resources/cookie-helper.sub.js></script>
+<script src=/storage-access-api/helpers.js></script>
<script>
- promise_setup(async () => {
- try {
- await test_driver.set_storage_access('*', '*', 'blocked');
- } catch (e) {
- // Ignore, can be unimplemented if the platform blocks cross-site
- // cookies by default. If this failed without default blocking the test
- // will fail.
- }
- });
+ async function CheckCrossSiteCookieAccess(t) {
+ const altOrigin = "https://{{hosts[alt][]}}:{{ports[https][0]}}";
+ const altPath = "/storage-access-api/resources/script-with-cookie-header.py?script=embedded_responder.js";
+ const url = `${altOrigin}${altPath}`;
+
+ await SetFirstPartyCookie(altOrigin);
+ t.add_cleanup(async () => {
+ await test_driver.delete_all_cookies();
+ await MaybeSetStorageAccess("*", "*", "allowed");
+ });
+
+ const frame = await CreateFrame(url);
+ const hasCookieAccess = await HasUnpartitionedCookie(frame);
+
+ return hasCookieAccess;
+ }
promise_test(async t => {
+ await MaybeSetStorageAccess("*", "*", "blocked");
+
+ if (await CheckCrossSiteCookieAccess(t)) {
+ // Nothing to test here, as cross-site cookies are not blocked.
+ // See https://github.com/privacycg/storage-access/issues/162.
+ return;
+ }
+
let linkInNewPage = null;
// Open a new tab and retrieve the link to start the test.