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

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

Issue 2550363002: Add LayoutTests for URL list of Response (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
Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
index 6b413a62d2f0d5339722277586629b77386f0e63..b5a83a7d4f69a27cf4409fab58b0ade7fe5133fd 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/redirect-loop.js
@@ -3,11 +3,24 @@ if (self.importScripts) {
importScripts('/fetch/resources/thorough-util.js');
}
+function createExpectedURLList(prefix, count, last) {
+ var array = [];
+ for (var i = count; i > 0; --i)
+ array.push(prefix + i);
+ array.push(last);
+ return array;
+}
+
var TEST_TARGETS = [
// Redirect loop: same origin -> same origin
[REDIRECT_LOOP_URL + encodeURIComponent(BASE_URL) + '&Count=20&mode=cors' +
'&credentials=same-origin',
- [fetchResolved, hasContentLength, hasBody, typeBasic],
+ [fetchResolved, hasContentLength, hasBody, typeBasic,
+ checkURLList.bind(
+ self,
+ createExpectedURLList(
+ REDIRECT_LOOP_URL + encodeURIComponent(BASE_URL) + '&Count=',
+ 19, BASE_URL))],
[methodIsGET, authCheck1]],
[REDIRECT_LOOP_URL + encodeURIComponent(BASE_URL) + '&Count=21&mode=cors' +
'&credentials=same-origin',
@@ -16,7 +29,14 @@ var TEST_TARGETS = [
// Redirect loop: same origin -> other origin
[REDIRECT_LOOP_URL + encodeURIComponent(OTHER_BASE_URL + '&ACAOrigin=*') +
'&Count=20&mode=cors&credentials=same-origin&method=GET',
- [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
+ [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors,
+ checkURLList.bind(
+ self,
+ createExpectedURLList(
+ REDIRECT_LOOP_URL +
+ encodeURIComponent(OTHER_BASE_URL + '&ACAOrigin=') + '%2A&Count=',
+ 19,
+ OTHER_BASE_URL + '&ACAOrigin=*'))],
[methodIsGET, authCheckNone]],
// FIXME: due to the current implementation of Chromium,
// Count=21 is resolved, Count=22 is rejected.
@@ -28,7 +48,15 @@ var TEST_TARGETS = [
// Redirect loop: other origin -> same origin
[OTHER_REDIRECT_LOOP_URL + encodeURIComponent(BASE_URL + 'ACAOrigin=*') +
'&Count=20&mode=cors&credentials=same-origin&method=GET&ACAOrigin=*',
- [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
+ [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors,
+ checkURLList.bind(
+ self,
+ createExpectedURLList(
+ OTHER_REDIRECT_LOOP_URL +
+ encodeURIComponent(BASE_URL + 'ACAOrigin=') +
+ '%2A&ACAOrigin=*&Count=',
+ 19,
+ BASE_URL + 'ACAOrigin=*'))],
[methodIsGET, authCheckNone]],
[OTHER_REDIRECT_LOOP_URL + encodeURIComponent(BASE_URL + 'ACAOrigin=*') +
'&Count=21&mode=cors&credentials=same-origin&method=GET&ACAOrigin=*',
@@ -38,7 +66,15 @@ var TEST_TARGETS = [
[OTHER_REDIRECT_LOOP_URL +
encodeURIComponent(OTHER_BASE_URL + 'ACAOrigin=*') +
'&Count=20&mode=cors&credentials=same-origin&method=GET&ACAOrigin=*',
- [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
+ [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors,
+ checkURLList.bind(
+ self,
+ createExpectedURLList(
+ OTHER_REDIRECT_LOOP_URL +
+ encodeURIComponent(OTHER_BASE_URL + 'ACAOrigin=') +
+ '%2A&ACAOrigin=*&Count=',
+ 19,
+ OTHER_BASE_URL + 'ACAOrigin=*'))],
[methodIsGET, authCheckNone]],
[OTHER_REDIRECT_LOOP_URL +
encodeURIComponent(OTHER_BASE_URL + 'ACAOrigin=*') +

Powered by Google App Engine
This is Rietveld 408576698