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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py

Issue 1854003004: Import web-platform-tests@5a8700479d98852455bee6117558897867eb278a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cfe6f4cec3bbcbb7df3be31c007d239e84836e1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py
@@ -0,0 +1,15 @@
+import os
+
+def main(request, response):
+ directory = os.path.dirname(__file__)
+
+ try:
+ file_name = request.GET.first("fn")
+ content_type = request.GET.first("ct")
+ with open(os.path.join(directory, file_name), "rb") as fh:
+ content = fh.read()
+
+ response.headers.set("Content-Type", content_type)
+ response.content = content
+ except:
+ response.set_error(400, "Not enough parameters or file not found")

Powered by Google App Engine
This is Rietveld 408576698