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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.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/thorough/redirect.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
index 3cb991f9aa784de7eb84fe7fc5dfca24cd51a90c..4d51346536ee96a652ea6b2322cc1446fc3d5851 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect.js
@@ -11,20 +11,38 @@ var TEST_TARGETS = [
responseRedirected, checkURLList.bind(self, [BASE_URL])],
[methodIsGET, authCheck1]],
- // https://fetch.spec.whatwg.org/#concept-http-fetch
- // Step 4, Case 301/302/303/307/308:
- // Step 2: If location is null, return response.
+ // https://fetch.spec.whatwg.org/#http-redirect-fetch
+ // Step 2: If actualResponse’s location URL is null, then return response.
[REDIRECT_URL + 'noLocation' +
'&mode=same-origin&method=GET&NoRedirectTest=true',
[fetchResolved, hasBody, typeBasic, responseNotRedirected,
checkURLList.bind(self, [])],
[checkJsonpNoRedirect]],
- // Step 5: If locationURL is failure, return a network error.
+ // Step 3: If actualResponse’s location URL is failure, then return a network
+ // error.
[REDIRECT_URL + 'http://' +
'&mode=same-origin&method=GET',
[fetchRejected]],
[REDIRECT_URL + encodeURIComponent(BASE_URL) +
+ '&mode=same-origin&redirectmode=manual&method=GET',
+ [fetchResolved, noBody, typeOpaqueredirect, responseNotRedirected,
+ checkURLList.bind(self, [])],
+ [checkJsonpError]],
+ [REDIRECT_URL + 'noLocation' +
+ '&mode=same-origin&redirectmode=manual&method=GET&NoRedirectTest=true',
+ [fetchResolved, noBody, typeOpaqueredirect, responseNotRedirected,
+ checkURLList.bind(self, [])],
+ [checkJsonpError]],
+ // According to the spec, even if the location URL is invalid, when the
+ // redirect mode is manual, fetch() must resolve with an opaque redirect
+ // filtered response. But currently Chrome handles the invalid location URL in
+ // the browser process as an error. See: crbug.com/707185
+ [REDIRECT_URL + 'http://' +
+ '&mode=same-origin&redirectmode=manual&method=GET&NoRedirectTest=true',
+ [fetchRejected]],
+
+ [REDIRECT_URL + encodeURIComponent(BASE_URL) +
'&mode=same-origin&method=GET&headers=CUSTOM',
[fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic,
responseRedirected, checkURLList.bind(self, [BASE_URL])],

Powered by Google App Engine
This is Rietveld 408576698