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

Unified Diff: LayoutTests/http/tests/fetch/script-tests/request.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
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 44ef797bf80e9f255a731fae91c734315fbbf0ce..b48444fdba834595753fafbea3cb3e866205e261 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -616,4 +616,32 @@ test(function() {
'for synthetic Request object');
}, 'RequestContext of a synthetic Request object');
+// Tests for requests redirect mode.
+test(function() {
+ var request1 = {};
+ var REDIRECT = ['follow', 'error'];
+ REDIRECT.forEach(function(redirect1) {
+ var init1 = {};
+ init1['redirect'] = redirect1;
+ request1 = new Request(URL, init1);
+ assert_equals(request1.redirect, redirect1,
+ 'Request.redirect with redirect mode ' + redirect1 +
+ ' should match');
+ request1 = new Request(request1);
+ assert_equals(request1.redirect, redirect1,
+ 'Request.redirect with redirect mode ' + redirect1 +
+ ' should match');
+
+ });
+ }, 'Request redirect mode test');
+
+test(function() {
+ assert_throws(
+ {name: 'TypeError'},
+ function() {
+ new Request('http://localhost/',{method: 'POST', redirect: 'manual'});
+ },
+ 'new Request with manual redirect mode should throw');
+
+ }, 'Request redirect with manual mode test');
done();

Powered by Google App Engine
This is Rietveld 408576698