diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-06-26 10:48:30 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-06-26 10:48:30 +0200 |
commit | 1359e8e4624d10ceb0bf55bcb1cb2903141c6d38 (patch) | |
tree | 131f289fd18efb5b28653f6b5d83953f8e6c820b /tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py | |
parent | f017169ae482effc446384050e79b752bd9ddfe5 (diff) | |
download | servo-1359e8e4624d10ceb0bf55bcb1cb2903141c6d38.tar.gz servo-1359e8e4624d10ceb0bf55bcb1cb2903141c6d38.zip |
Move `tests/wpt/web-platform-tests` to `tests/wpt/tests`
Diffstat (limited to 'tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py')
-rw-r--r-- | tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py deleted file mode 100644 index 9610734d444..00000000000 --- a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-json-then-js.py +++ /dev/null @@ -1,21 +0,0 @@ -# Respond with valid JSON to the first request with the given key, -# and with valid JavaScript to the second. Used for testing scenarios where -# the same request URL results in different responses on subsequent requests. -def main(request, response): - try: - stash_key = request.GET.first(b"key") - - run_count = request.server.stash.take(stash_key) - if not run_count: - run_count = 0 - - if run_count == 0: - response.headers.set(b"Content-Type", b"text/json") - response.content = '{"hello": "world"}' - else: - response.headers.set(b"Content-Type", b"application/javascript") - response.content = "export default 'hello';" - - request.server.stash.put(stash_key, run_count + 1) - except: - response.set_error(400, u"Not enough parameters") |