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

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: 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/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 e6f00e2e8e7e500ff01f2484d578d0a526036f0a..662f235afd1327f6d6ac0bd87a818a4700f04779 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
@@ -247,6 +247,32 @@ promise_test(function(t) {
}, 'Manual redirect fetch returns opaque redirect response');
promise_test(function(t) {
+ var redirect_target_url = 'noLocation';
+ var redirect_original_url =
+ BASE_ORIGIN + '/serviceworker/resources/redirect.php?Redirect=' +
+ redirect_target_url;
hiroshige 2017/04/12 00:25:42 nit: just using '/serviceworker/resources/redirect
horo 2017/04/12 04:48:39 Done.
+
+ 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