forked from kdashg/gecko-cinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1846805 [wpt PR 41294] - Add web platform test for recency in gen…
…erateBid(), a=testonly Automatic update from web-platform-tests Add web platform test for recency in generateBid() Add a web platform test to test recency of browserSignals in generateBid() is below a certain 5 minutes threshold and is rounded to multiple of 100 milliseconds. Re-introduces code from crrev.com/c/4727328 that was reverted due to an mac11-arm64-rel failure. The failure was fixed in this CL by removing the non-virtual expected file. Bug: 1425952 Change-Id: I9922ce0ec79b9d73ede1d3d9ffd1d1dc498c3798 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4742524 Reviewed-by: Caleb Raitto <caraitto@chromium.org> Commit-Queue: Tianyang Xu <xtlsheep@google.com> Cr-Commit-Position: refs/heads/main@{#1179687} -- wpt-commits: 9946d998fd588bed9f97dc7fa465896c54b910b0 wpt-pr: 41294
- Loading branch information
1 parent
c56d7f5
commit 1645ecf
Showing
5 changed files
with
216 additions
and
182 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
testing/web-platform/tests/fledge/tentative/generate-bid-recency.https.sub.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// META: script=/resources/testdriver.js | ||
// META: script=/common/utils.js | ||
// META: script=resources/fledge-util.js | ||
// META: timeout=long | ||
|
||
"use strict;" | ||
|
||
promise_test(async test => { | ||
const uuid = generateUuid(test); | ||
await runReportTest( | ||
test, uuid, | ||
{ generateBid: | ||
`if (browserSignals.recency === undefined) | ||
throw new Error("Missing recency in browserSignals.") | ||
if (browserSignals.recency < 0) | ||
throw new Error("Recency is a negative value.") | ||
if (browserSignals.recency > 30000) | ||
throw new Error("Recency is over 30 seconds threshold.") | ||
if (browserSignals.recency % 100 !== 0) | ||
throw new Error("Recency is not rounded to multiple of 100 milliseconds.") | ||
return {'bid': 9, | ||
'render': interestGroup.ads[0].renderUrl};`, | ||
reportWin: | ||
`sendReportTo('${createBidderReportUrl(uuid)}');` }, | ||
// expectedReportUrls | ||
[createBidderReportUrl(uuid)] | ||
); | ||
}, 'Check recency in generateBid() is below a certain threshold and rounded ' + | ||
'to multiple of 100 milliseconds.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.