Files
sousa-gecko/testing/web-platform/tests/fledge/tentative/cross-origin-embedder-policy.https.window.js
T
Matt Menke 076e3cbaae Bug 1958543 [wpt PR 51862] - [Protected Audience] Clear most of ClientSecurityState for PA fetches., a=testonly
Automatic update from web-platform-tests
[Protected Audience] Clear most of ClientSecurityState for PA fetches.

Make the ClientSecurityState used by Protected Audience fetches only
have populated `ip_address_space`, `is_web_secure_context`, and
`private_network_request_policy` fields. This both matches the spec,
and avoids leaking data through reports from requests that should be
isolated from the page running the auction.

Bug: 385152122
Change-Id: If5ffcbd5fcd489da92157a633eb384f38fa2b1ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6426692
Commit-Queue: mmenke <mmenke@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1442908}

--

wpt-commits: 18c417a8d3cd595c15502ba4b90d8786caa20188
wpt-pr: 51862
2025-04-09 11:12:46 +00:00

40 lines
1.3 KiB
JavaScript

// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
// META: script=/common/utils.js
// META: script=resources/fledge-util.sub.js
// META: timeout=long
"use strict";
promise_test(async test => {
const uuid = generateUuid(test);
let otherWindow = await createTopLevelWindow(test, OTHER_ORIGIN1);
// Join a cross-origin InterestGroup in a top-level window navigated to its origin.
// Has to be top-level to avoid being subject to the Cross-Origin-Embedder-Policy
// of this page.
await runInFrame(test, otherWindow,
`await joinInterestGroup(test_instance, "${uuid}");`);
// Run an auction in this frame using the other origin as a bidder. The bidding
// script load should not be blocked by the COEP that blocks cross-origin
// resources.
await runBasicFledgeTestExpectingWinner(
test, uuid,
{ interestGroupBuyers: [OTHER_ORIGIN1] });
}, 'COEP does not block bidder scripts.');
promise_test(async test => {
const uuid = generateUuid(test);
// Run an auction with a cross-origin seller script, it should not be blocked
// by COEP.
await joinGroupAndRunBasicFledgeTestExpectingWinner(
test,
{ uuid,
auctionConfigOverrides : {seller: OTHER_ORIGIN1,
decisionLogicURL: createDecisionScriptURL(uuid, { origin: OTHER_ORIGIN1 })
}});
}, 'COEP does not block seller scripts.');