Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py

Issue 2913553004: Add the 'cache' datatype to the clear-site-data WPT (Closed)
Patch Set: Rebase, syntax, cache busting. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py
index e8ec8d55327c28339c7466fcf613ff784359f2e1..9cb8beef60cc72220f3b156b0df0373e0340407d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py
+++ b/third_party/WebKit/LayoutTests/external/wpt/clear-site-data/support/echo-clear-site-data.py
@@ -9,6 +9,8 @@ RESPONSE = """
</head>
<body>
<script>
+ TestUtils.setCachedResourceName("%s");
+
/**
* A map between a datatype name and whether it is empty.
* @property Object.<string, boolean>
@@ -33,8 +35,13 @@ RESPONSE = """
# of the datatypes, so that if used in an iframe, it can inform the
# embedder whether the data deletion succeeded.
def main(request, response):
- types = [key for key in request.GET.keys()]
- header = json.dumps({ "types": types })
+ if "cached_resource_name" not in request.GET.keys():
+ raise ("Invalid request: Please include the 'cached_resource_name' GET "
+ "parameter, otherwise cache emptiness can not be verified.")
+
+ types = [key for key in request.GET.keys()
+ if key != "cached_resource_name"]
+ header = ",".join("\"" + type + "\"" for type in types)
return ([("Clear-Site-Data", header),
("Content-Type", "text/html")],
- RESPONSE)
+ RESPONSE % request.GET["cached_resource_name"])

Powered by Google App Engine
This is Rietveld 408576698