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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js

Issue 2524703002: Introduce Response.redirect attribute and add LayoutTest. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
index a440a4a8dc763b14459d4b969e41981bcdeedabd..4592b1b3affd3719d5c59c6bf7789f3fd89583a4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/resources/thorough-util.js
@@ -65,6 +65,14 @@ var checkFetchResponseType = function(type, url, data) {
type,
'type must match. url: ' + url);
};
+var checkFetchResponseRedirected = function(expected, url, data) {
+ assert_equals(data.fetchResult,
+ 'resolved',
+ 'fetchResult must be resolved. url = ' + url);
+ assert_equals(data.redirected,
+ expected,
+ url + ' redirected flag should match');
+};
var checkURLList = function(redirectedURLList, url, data) {
if (!self.internals)
return;
@@ -102,6 +110,8 @@ var noServerHeader =
var typeBasic = checkFetchResponseType.bind(this, 'basic');
var typeCors = checkFetchResponseType.bind(this, 'cors');
var typeOpaque = checkFetchResponseType.bind(this, 'opaque');
+var responseRedirected = checkFetchResponseRedirected.bind(this, true);
+var responseNotRedirected = checkFetchResponseRedirected.bind(this, false);
// Functions to check the result of JSONP which is evaluated in
// thorough-iframe.html by appending <script> element.
@@ -365,6 +375,7 @@ function doFetch(request) {
status: response.status,
headers: headersToArray(response.headers),
type: response.type,
+ redirected: response.redirected,
urlList: self.internals ?
self.internals.getInternalResponseURLList(response) :
[],
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698