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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js

Issue 2785123002: Make no-location redirect response to be "opaque redirect" when redirect mode is manual. (Closed)
Patch Set: add link to crbug.com/707185 Created 3 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/http/tests/fetch/script-tests/fetch.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
index 37f42f035c76b6f274cc04b100cfe453eeade487..6f3d38b9ecc18b3985855ab606a4946a6dbf14f5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
@@ -244,6 +244,30 @@ promise_test(function(t) {
}, 'Manual redirect fetch returns opaque redirect response');
promise_test(function(t) {
+ var redirect_original_url =
+ BASE_ORIGIN + '/serviceworker/resources/redirect.php?Redirect=noLocation';
+
+ var request = new Request(redirect_original_url, {redirect: 'manual'});
+ assert_equals(request.url, redirect_original_url,
+ 'Request\'s url is the original URL');
+ assert_equals(request.redirect, 'manual');
+
+ return fetch(request)
+ .then(function(response) {
+ assert_equals(response.status, 0);
+ assert_equals(response.type, 'opaqueredirect');
+ assert_equals(response.url, request.url);
+ assert_false(response.redirected);
+ if (self.internals) {
+ assert_array_equals(
+ self.internals.getInternalResponseURLList(response),
+ [redirect_original_url]);
+ }
+ });
+ }, 'Manual redirect fetch returns opaque redirect response even if location' +
+ 'header is not set');
+
+promise_test(function(t) {
var redirect_target_url =
OTHER_ORIGIN + '/fetch/resources/fetch-status.php?status=200';
var redirect_original_url =

Powered by Google App Engine
This is Rietveld 408576698