summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/syntax/speculative-charset/support/script.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/syntax/speculative-charset/support/script.py')
-rw-r--r--testing/web-platform/tests/html/syntax/speculative-charset/support/script.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/syntax/speculative-charset/support/script.py b/testing/web-platform/tests/html/syntax/speculative-charset/support/script.py
new file mode 100644
index 0000000000..0dbf5be0ac
--- /dev/null
+++ b/testing/web-platform/tests/html/syntax/speculative-charset/support/script.py
@@ -0,0 +1,18 @@
+import time
+
+def main(request, response):
+ response.add_required_headers = False # Don't implicitly add HTTP headers
+ response.writer.write_status(200)
+ response.writer.write_header("Content-Type", "text/javascript")
+ response.writer.end_headers()
+
+ token = request.GET[b"uuid"]
+ character = request.GET[b"character"]
+ old_character = b"NOT LOADED PREVIOUSLY";
+ from_stash = request.server.stash.take(token);
+ if from_stash:
+ old_character = from_stash
+ else:
+ request.server.stash.put(token, character)
+
+ response.writer.write(b'parent.postMessage("token: %s, character: %s, previous character: %s, byte: \xE6", "*");' % (token, character, old_character));