Skip to content

Commit

Permalink
Add tests for feature detection logic
Browse files Browse the repository at this point in the history
I'll be removing the feature flag in a subsequent CL now that we've
shipped, so I don't test the flag off case.

More context on the feature detection method at
WICG/turtledove#803

Bug: 1462720
  • Loading branch information
caraitto authored and chromium-wpt-export-bot committed Nov 15, 2023
1 parent 1bc99b6 commit 3f4fe38
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions fledge/tentative/direct-from-seller-signals.https.window.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ subsetTest(promise_test, async test => {
await runReportTest(
test, uuid,
directFromSellerSignalsValidatorCode(
uuid, /*expectedSellerSignals=*/null,
/*expectedAuctionSignals=*/null, /*expectedPerBuyerSignals=*/null),
uuid, /*expectedSellerSignals=*/ null,
/*expectedAuctionSignals=*/ null, /*expectedPerBuyerSignals=*/ null),
// expectedReportUrls
[createSellerReportURL(uuid), createBidderReportURL(uuid)],
// renderURLOverride
null,
// auctionConfigOverrides
{ directFromSellerSignalsHeaderAdSlot: 'adSlot/0'}
);
{directFromSellerSignalsHeaderAdSlot: 'adSlot/0'});
}, 'Test directFromSellerSignals with empty Ad-Auction-Signals header.');

subsetTest(promise_test, async test => {
Expand Down Expand Up @@ -495,3 +494,11 @@ subsetTest(promise_test, async test => {
{ directFromSellerSignalsHeaderAdSlot: 'adSlot' }
);
}, 'Test directFromSellerSignals with network error.');

subsetTest(promise_test, async test => {
let dfss = false;
navigator.runAdAuction({
get directFromSellerSignalsHeaderAdSlot() { dfss = true; }
}).catch((e) => {});
assert_true(dfss);
}, 'Test directFromSellerSignals feature detection.');

0 comments on commit 3f4fe38

Please sign in to comment.