Bug 1870374 [wpt PR 43694] - [FLEDGE] Fix keys trustedBiddingSignalsSlotSizeMode uses., a=testonly

Automatic update from web-platform-tests
[FLEDGE] Fix keys trustedBiddingSignalsSlotSizeMode uses.

The new trustedBiddingSignalsSlotSizeMode feature in Protected Audiences
appends query params containing ad slot size to trusted bidding signals
fetches. It currently appends "&slot-size=..." and
"&all-slots-requested-sizes=...".

All other query param names added by the Protected Audience API
use camel case, so those should be using camel case as well. This CL
renames them both.

There's one remaining comment in a mojom file that refers to the old
values that this CL doesn't fix, since that requires additional review.

Bug: 1512132
Change-Id: Iaa41334154e18eae26919d204006f974df1046c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5123157
Auto-Submit: Matt Menke <mmenke@chromium.org>
Reviewed-by: Russ Hamilton <behamilton@google.com>
Commit-Queue: Russ Hamilton <behamilton@google.com>
Cr-Commit-Position: refs/heads/main@{#1238205}

--

wpt-commits: f2e65e6194ed7218610a054663026c8114a07852
wpt-pr: 43694
This commit is contained in:
Matt Menke 2023-12-18 09:27:58 +00:00 committed by moz-wptsync-bot
parent 31a9aa9cb4
commit a767b43c13
2 changed files with 19 additions and 19 deletions

View File

@ -32,7 +32,7 @@ def main(request, response):
if pair[0] == "interestGroupNames" and interestGroupNames == None:
interestGroupNames = list(map(unquote_plus, pair[1].split(",")))
continue
if pair[0] == "slot-size" or pair[0] == "all-slots-requested-sizes":
if pair[0] == "slotSize" or pair[0] == "allSlotsRequestedSizes":
continue
return fail(response, "Unexpected query parameter: " + param)
@ -104,10 +104,10 @@ def main(request, response):
value = request.GET.first(b"hostname", b"not-found").decode("ASCII")
elif key == "headers":
value = headersToAscii(request.headers)
elif key == "slot-size":
value = request.GET.first(b"slot-size", b"not-found").decode("ASCII")
elif key == "all-slots-requested-sizes":
value = request.GET.first(b"all-slots-requested-sizes", b"not-found").decode("ASCII")
elif key == "slotSize":
value = request.GET.first(b"slotSize", b"not-found").decode("ASCII")
elif key == "allSlotsRequestedSizes":
value = request.GET.first(b"allSlotsRequestedSizes", b"not-found").decode("ASCII")
responseBody["keys"][key] = value
if "data-version" in interestGroupNames:

View File

@ -463,11 +463,11 @@ async function runTrustedBiddingSignalsSlotSizeTest(
uuidOverride = null) {
await runTrustedBiddingSignalsTest(
test,
`trustedBiddingSignals["slot-size"] ===
`trustedBiddingSignals["slotSize"] ===
${JSON.stringify(expectedSlotSize)} &&
trustedBiddingSignals["all-slots-requested-sizes"] ===
trustedBiddingSignals["allSlotsRequestedSizes"] ===
${JSON.stringify(expectedAllSlotsRequestedSizes)}`,
{ trustedBiddingSignalsKeys: ['slot-size', 'all-slots-requested-sizes'],
{ trustedBiddingSignalsKeys: ['slotSize', 'allSlotsRequestedSizes'],
trustedBiddingSignalsSlotSizeMode: trustedBiddingSignalsSlotSizeMode,
trustedBiddingSignalsURL: TRUSTED_BIDDING_SIGNALS_URL},
auctionConfigOverrides,
@ -664,13 +664,13 @@ subsetTest(promise_test, async test => {
[ joinInterestGroup(
test, uuid,
{ name: 'group 1',
trustedBiddingSignalsKeys: ['slot-size', 'all-slots-requested-sizes'],
trustedBiddingSignalsKeys: ['slotSize', 'allSlotsRequestedSizes'],
trustedBiddingSignalsSlotSizeMode: 'none',
trustedBiddingSignalsURL: TRUSTED_BIDDING_SIGNALS_URL,
biddingLogicURL: createBiddingScriptURL(
{ generateBid:
`if (trustedBiddingSignals["slot-size"] !== "not-found" ||
trustedBiddingSignals["all-slots-requested-sizes"] !== "not-found") {
`if (trustedBiddingSignals["slotSize"] !== "not-found" ||
trustedBiddingSignals["allSlotsRequestedSizes"] !== "not-found") {
throw "unexpected trustedBiddingSignals";
}
return {bid: 5, render: interestGroup.ads[0].renderURL};`,
@ -678,33 +678,33 @@ subsetTest(promise_test, async test => {
joinInterestGroup(
test, uuid,
{ name: 'group 2',
trustedBiddingSignalsKeys: ['slot-size', 'all-slots-requested-sizes'],
trustedBiddingSignalsKeys: ['slotSize', 'allSlotsRequestedSizes'],
trustedBiddingSignalsSlotSizeMode: 'slot-size',
trustedBiddingSignalsURL: TRUSTED_BIDDING_SIGNALS_URL,
biddingLogicURL: createBiddingScriptURL(
{ generateBid:
`if (trustedBiddingSignals["slot-size"] === "not-found" ||
trustedBiddingSignals["all-slots-requested-sizes"] !== "not-found") {
`if (trustedBiddingSignals["slotSize"] === "not-found" ||
trustedBiddingSignals["allSlotsRequestedSizes"] !== "not-found") {
throw "unexpected trustedBiddingSignals";
}
// Group 3 bids using the first digit of the first dimension.
return { bid: trustedBiddingSignals["slot-size"].substr(0, 1),
return { bid: trustedBiddingSignals["slotSize"].substr(0, 1),
render: interestGroup.ads[0].renderURL};`,
reportWin: `sendReportTo("${group2ReportURL}");`})}),
joinInterestGroup(
test, uuid,
{ name: 'group 3',
trustedBiddingSignalsKeys: ['slot-size', 'all-slots-requested-sizes'],
trustedBiddingSignalsKeys: ['slotSize', 'allSlotsRequestedSizes'],
trustedBiddingSignalsSlotSizeMode: 'all-slots-requested-sizes',
trustedBiddingSignalsURL: TRUSTED_BIDDING_SIGNALS_URL,
biddingLogicURL: createBiddingScriptURL(
{ generateBid:
`if (trustedBiddingSignals["slot-size"] !== "not-found" ||
trustedBiddingSignals["all-slots-requested-sizes"] === "not-found") {
`if (trustedBiddingSignals["slotSize"] !== "not-found" ||
trustedBiddingSignals["allSlotsRequestedSizes"] === "not-found") {
throw "unexpected trustedBiddingSignals";
}
// Group 3 bids using the second digit of the first dimension.
return { bid: trustedBiddingSignals["all-slots-requested-sizes"].substr(1, 1),
return { bid: trustedBiddingSignals["allSlotsRequestedSizes"].substr(1, 1),
render: interestGroup.ads[0].renderURL};`,
reportWin: `sendReportTo("${group3ReportURL}");`})}),
]