From 75b623d4f9148e8ad69c31a1083b20829c87a4ed Mon Sep 17 00:00:00 2001 From: Anthony Garant Date: Mon, 17 Apr 2023 13:41:26 +0000 Subject: [PATCH] Bug 1827693 [wpt PR 39503] - Remove un-needed clear stash logic, a=testonly Automatic update from web-platform-tests Remove un-needed clear stash logic The stash keeps context between requests. However, it is cleared between tests. The current setup requested the stash to be removed after the test. This can be skipped. In this CL we simply remove the logic associated to clearing the stash. Change-Id: Ia1ccb16687320b3c52a4039b4ce098ed49bcfe44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4419468 Commit-Queue: Anthony Garant Reviewed-by: Andrew Paseltiner Cr-Commit-Position: refs/heads/main@{#1129415} -- wpt-commits: dd4a28d6e3b7b989705c1f3734ec13f9cbc0ea98 wpt-pr: 39503 --- .../tests/attribution-reporting/resources/reports.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/testing/web-platform/tests/attribution-reporting/resources/reports.py b/testing/web-platform/tests/attribution-reporting/resources/reports.py index 432f5c61d5e9..4d4c3fd5ec73 100644 --- a/testing/web-platform/tests/attribution-reporting/resources/reports.py +++ b/testing/web-platform/tests/attribution-reporting/resources/reports.py @@ -13,8 +13,6 @@ Header = Tuple[str, str] Status = Tuple[int, str] Response = Tuple[Status, List[Header], str] -CLEAR_STASH = isomorphic_encode("clear_stash") - def decode_headers(headers: dict) -> dict: """Decodes the headers from wptserve. @@ -40,14 +38,8 @@ def handle_post_report(request: Request, headers: List[Header]) -> Response: """Handles POST request for reports. Retrieves the report from the request body and stores the report in the - stash. If clear_stash is specified in the query params, clears the stash. + stash. """ - if request.GET.get(CLEAR_STASH): - clear_stash(request.server.stash) - return (200, "OK"), headers, json.dumps({ - "code": 200, - "message": "Stash successfully cleared.", - }) store_report( request.server.stash, get_request_origin(request), { "body": request.body.decode("utf-8"), @@ -97,12 +89,6 @@ def take_reports(stash: Stash, origin: str) -> List[str]: return reports -def clear_stash(stash: Stash) -> None: - "Clears the stash." - stash.take(REPORTS) - return None - - def handle_reports(request: Request) -> Response: """Handles request to get or store reports.""" headers = [("Content-Type", "application/json")] -- 2.11.4.GIT