diff options
Diffstat (limited to 'testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py')
-rw-r--r-- | testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py b/testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py index f9ca9031f1..955a7c0bdf 100644 --- a/testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py +++ b/testing/web-platform/tests/fledge/tentative/resources/trusted-bidding-signals.py @@ -1,3 +1,4 @@ +import collections import json from urllib.parse import unquote_plus @@ -47,7 +48,8 @@ def main(request, response): response.status = (200, b"OK") # The JSON representation of this is used as the response body. This does - # not currently include a "perInterestGroupData" object. + # not currently include a "perInterestGroupData" object except for + # updateIfOlderThanMs. responseBody = {"keys": {}} # Set when certain special keys are observed, used in place of the JSON @@ -117,6 +119,22 @@ def main(request, response): if "data-version" in interestGroupNames: dataVersion = "4" + per_interest_group_data = collections.defaultdict(dict) + for name in interestGroupNames: + if name == "use-update-if-older-than-ms": + # One hour in milliseconds. + per_interest_group_data[name]["updateIfOlderThanMs"] = 3_600_000 + elif name == "use-update-if-older-than-ms-small": + # A value less than the minimum of 10 minutes. + per_interest_group_data[name]["updateIfOlderThanMs"] = 1 + elif name == "use-update-if-older-than-ms-zero": + per_interest_group_data[name]["updateIfOlderThanMs"] = 0 + elif name == "use-update-if-older-than-ms-negative": + per_interest_group_data[name]["updateIfOlderThanMs"] = -1 + + if per_interest_group_data: + responseBody["perInterestGroupData"] = dict(per_interest_group_data) + if contentType: response.headers.set("Content-Type", contentType) if adAuctionAllowed: |