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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py

Issue 2790433003: Support redirect responses for NavigationPreload (Closed)
Patch Set: incorporated falken's comment Created 3 years, 9 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/service-workers/service-worker/navigation-preload/resources/redirect-scope.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py
new file mode 100644
index 0000000000000000000000000000000000000000..88dcc8ebc05c6a3a2bc91a37c3bfe547392f5bec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-preload/resources/redirect-scope.py
@@ -0,0 +1,36 @@
+def main(request, response):
+ if "base" in request.GET:
+ return [("Content-Type", "text/html")], "OK"
+ type = request.GET.first("type")
+
+ if type == "normal":
+ response.status = 302
+ response.headers.append("Location", "redirect-redirected.html")
+ response.headers.append("Custom-Header", "hello")
+ return ""
+
+ if type == "no-location":
+ response.status = 302
+ response.headers.append("Custom-Header", "hello")
+ return ""
+
+ if type == "no-location-with-body":
+ response.status = 302
+ response.headers.append("Custom-Header", "hello")
+ return "<body>BODY</body>"
+
+ if type == "redirect-to-scope":
+ response.status = 302
+ response.headers.append("Location",
+ "redirect-scope.py?type=redirect-to-scope2")
+ return ""
+ if type == "redirect-to-scope2":
+ response.status = 302
+ response.headers.append("Location",
+ "redirect-scope.py?type=redirect-to-scope3")
+ return ""
+ if type == "redirect-to-scope3":
+ response.status = 302
+ response.headers.append("Location", "redirect-redirected.html")
+ response.headers.append("Custom-Header", "hello")
+ return ""

Powered by Google App Engine
This is Rietveld 408576698