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

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

Issue 2550363002: Add LayoutTests for URL list of Response (Closed)
Patch Set: s/thired/third/ 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/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 8646486fd68403396158e97d3173ec687fadc970..f39474354ac2fb7316e58d2d7f0b5a17266c6d36 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,17 @@ var checkFetchResponseType = function(type, url, data) {
type,
'type must match. url: ' + url);
};
+var checkURLList = function(redirectedURLList, url, data) {
+ if (!self.internals)
+ return;
+ var expectedURLList = [url].concat(redirectedURLList);
+ assert_equals(data.fetchResult,
+ 'resolved',
+ 'fetchResult must be resolved. url = ' + url);
+ assert_array_equals(data.urlList,
+ expectedURLList,
+ url + ' URL list should match');
+};
var showComment = function(url, data) {
assert_true(!data.comment, 'Show comment: ' + data.comment + ' url: ' + url);
@@ -354,6 +365,9 @@ function doFetch(request) {
status: response.status,
headers: headersToArray(response.headers),
type: response.type,
+ urlList: self.internals ?
+ self.internals.getInternalResponseURLList(response) :
+ [],
response: response,
originalURL: originalURL
});
@@ -375,6 +389,12 @@ function report(data) {
report_data = data;
}
+// |test_target| is an array. The first element of |test_target| is the URL to
+// be fetched. The second element of |test_target| is an array of test functions
+// which will be called with the result of doFetch(). The third element of
+// |test_target| is an array of test functions which will be called with
+// |report_data| set by report() which is called while executing
+// "eval(message.body)".
function executeTest(test_target) {
if (test_target.length == 0) {
return Promise.resolve();

Powered by Google App Engine
This is Rietveld 408576698