Skip to content

Commit

Permalink
Bug 1892451 [wpt PR 45802] - Protected Audience: Add missing renderSi…
Browse files Browse the repository at this point in the history
…ze field to browserSignals of scoreAd., a=testonly

Automatic update from web-platform-tests
Protected Audience: Add missing renderSize field to browserSignals of
scoreAd.

The Protected Audience explainer claims the browserSignals argument of
scoreAd function should contain an optional field of renderSize.
However, it is found that this has not been implemented. See:
https://github.com/WICG/turtledove/blob/main/FLEDGE.md#:~:text=%27renderSize%27%3A%20%7Bwidth%3A%20100%2C%20height%3A%20200%7D%2C%20/*%20if%20specified%20in%20the%20bid%20*/

This CL implements this optional field to match what the explainer
claims.

See: WICG/turtledove#1088

Spec PR: WICG/turtledove#1141
Explainer PR: WICG/turtledove#1145

Bug: 333628467
Change-Id: I95d5ebb7ddbbeb50d0ac3618e22ed1e228ec32a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5447954
Reviewed-by: Caleb Raitto <caraitto@chromium.org>
Commit-Queue: Xiaochen Zhou <xiaochenzh@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294870}

--

wpt-commits: 3c8f88bb2b952e67e70a7a896ef6b0cf259603f0
wpt-pr: 45802
  • Loading branch information
xiaochen-z authored and moz-wptsync-bot committed May 6, 2024
1 parent fc97ee9 commit 79bb0a1
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// META: script=/resources/testdriver.js
// META: script=/common/utils.js
// META: script=resources/fledge-util.sub.js
// META: script=/common/subset-tests.js
// META: timeout=long

"use strict;"

// These tests focus on the browserSignals argument passed to scoreAd().

subsetTest(promise_test, async test => {
const uuid = generateUuid(test);

let biddingLogicURL = createBiddingScriptURL(
{
generateBid:
`
return {
bid: 1,
render: { url: interestGroup.ads[0].renderURL,
width: '100sw',
height: '50px' }
};
`
});

let decisionLogicURL = createDecisionScriptURL(uuid,
{
scoreAd:
`
if (!browserSignals.hasOwnProperty('renderSize')) {
throw 'Missing renderSize member in browserSignals.';
}
if (browserSignals.renderSize.width !== '100sw' ||
browserSignals.renderSize.height !== '50px') {
throw 'Incorrect renderSize width or height.';
}
`
}
);

await joinGroupAndRunBasicFledgeTestExpectingWinner(
test,
{
uuid: uuid,
interestGroupOverrides: {
name: uuid,
biddingLogicURL: biddingLogicURL,
ads: [{ renderURL: createRenderURL(uuid), sizeGroup: 'group1' }],
adSizes: { 'size1': { width: '100sw', height: '50px' } },
sizeGroups: { 'group1': ['size1'] }
},
auctionConfigOverrides: {
decisionLogicURL: decisionLogicURL
}
});
}, 'ScoreAd browserSignals renderSize test.');

0 comments on commit 79bb0a1

Please sign in to comment.