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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/fetch.js

Issue 1143083002: Implement request's redirect mode and RequestRedirect for Fetch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/fetch/script-tests/request.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/fetch/script-tests/fetch.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/fetch.js b/LayoutTests/http/tests/fetch/script-tests/fetch.js
index 6df3f6be913a6b3bb1be66712ce9bf75e9c02c2a..6d9c9172b10d7e1aa0beb18acb37122069616cb1 100644
--- a/LayoutTests/http/tests/fetch/script-tests/fetch.js
+++ b/LayoutTests/http/tests/fetch/script-tests/fetch.js
@@ -56,6 +56,7 @@ sequential_promise_test(function(t) {
assert_equals(request.url,
BASE_ORIGIN + '/fetch/resources/fetch-status.php?status=200');
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'follow');
return fetch(request)
.then(function(response) {
@@ -68,6 +69,7 @@ sequential_promise_test(function(t) {
BASE_ORIGIN +
'/fetch/resources/fetch-status.php?status=200');
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'follow');
});
}, 'Request/response url attribute getter with fragment');
@@ -78,10 +80,11 @@ sequential_promise_test(function(t) {
BASE_ORIGIN + '/serviceworker/resources/redirect.php?Redirect=' +
redirect_target_url;
- var request = new Request(redirect_original_url);
+ var request = new Request(redirect_original_url, {redirect: 'follow'});
assert_equals(request.url, redirect_original_url,
'Request\'s url is the original URL');
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'follow');
return fetch(request)
.then(function(response) {
@@ -92,6 +95,7 @@ sequential_promise_test(function(t) {
assert_equals(request.url, redirect_original_url,
'Request\'s url remains the original URL');
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'follow');
});
}, 'Request/response url attribute getter with redirect');
@@ -108,9 +112,11 @@ sequential_promise_test(function(t) {
new Request('/serviceworker/resources/fetch-access-control.php',
{
method: 'POST',
+ redirect: 'error',
body: new Blob(['Test Blob'], {type: 'test/type'})
});
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'error');
return fetch(request)
.then(function(response) { return response.text(); })
.then(evalJsonp)
@@ -118,6 +124,7 @@ sequential_promise_test(function(t) {
assert_equals(result.method, 'POST');
assert_equals(result.body, 'Test Blob');
assert_equals(request.context, '');
+ assert_equals(request.redirect, 'error');
});
}, 'Fetch with Blob body test');
« no previous file with comments | « no previous file | LayoutTests/http/tests/fetch/script-tests/request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698