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/request.js

Issue 1280733002: [3/3 blink] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Redirect1
Patch Set: add comment Created 5 years, 4 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: LayoutTests/http/tests/fetch/script-tests/request.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/request.js b/LayoutTests/http/tests/fetch/script-tests/request.js
index f0aacb885a4837b6fcb75a356d5a414055e14331..555b6767491a1a8a136a4ae4d7fda011a6e5be81 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -222,6 +222,33 @@ test(function() {
}, 'Request credentials test');
test(function() {
+ var request1 = {};
+ var request2 = {};
+ var REDIRECTS = ['follow', 'error', 'manual', '', undefined];
+ REDIRECTS.forEach(function(redirect1) {
+ var init1 = {};
+ if (redirect1 != undefined) { init1['redirect'] = redirect1; }
+ request1 = new Request(URL, init1);
+ assert_equals(request1.redirect, redirect1 || 'follow',
+ 'Request.redirect should match');
+ request1 = new Request(request1);
+ assert_equals(request1.redirect, redirect1 || 'follow',
+ 'Request.redirect should match');
+ REDIRECTS.forEach(function(redirect2) {
+ request1 = new Request(URL, init1);
+ var init2 = {};
+ if (redirect2 != undefined) {
+ init2['redirect'] = redirect2;
+ }
+ request2 = new Request(request1, init2);
+ assert_equals(request2.redirect,
+ redirect2 ? redirect2 : request1.redirect,
+ 'Request.redirect should be overridden');
+ });
+ });
+ }, 'Request redirect test');
+
+test(function() {
['same-origin', 'cors', 'no-cors'].forEach(function(mode) {
FORBIDDEN_METHODS.forEach(function(method) {
assert_throws(
« no previous file with comments | « LayoutTests/http/tests/fetch/script-tests/fetch.js ('k') | LayoutTests/http/tests/serviceworker/fetch-request-redirect.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698