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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/clear-site-data/support/echo-clear-site-data.py

Issue 2572333003: Import wpt@4970d7334aaf8977c5b617075aa48be1b6e482c7 (Closed)
Patch Set: Update TestExpectations Created 4 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 import json
2
3 RESPONSE = """
4 <!DOCTYPE html>
5 <html>
6 <head>
7 <title>Clear-Site-Data</title>
8 <script src="test_utils.js"></script>
9 </head>
10 <body>
11 <script>
12 /**
13 * A map between a datatype name and whether it is empty.
14 * @property Object.<string, boolean>
15 */
16 var report = {};
17
18 Promise.all(TestUtils.DATATYPES.map(function(datatype) {
19 return datatype.isEmpty().then(function(isEmpty) {
20 report[datatype.name] = isEmpty;
21 });
22 })).then(function() {
23 window.top.postMessage(report, "*");
24 });
25 </script>
26 </body>
27 </html>
28 """
29
30 # A support server that receives a list of datatypes in the GET query
31 # and returns a Clear-Site-Data header with those datatypes. The content
32 # of the response is a html site using postMessage to report the status
33 # of the datatypes, so that if used in an iframe, it can inform the
34 # embedder whether the data deletion succeeded.
35 def main(request, response):
36 types = [key for key in request.GET.keys()]
37 header = json.dumps({ "types": types })
38 return ([("Clear-Site-Data", header),
39 ("Content-Type", "text/html")],
40 RESPONSE)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698