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

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..3af08e837cc097bd8dc5c07c773ee1a351850cd0 100644
--- a/LayoutTests/http/tests/fetch/script-tests/request.js
+++ b/LayoutTests/http/tests/fetch/script-tests/request.js
@@ -616,4 +616,29 @@ 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 || 'follow',
yhirano 2015/05/25 06:30:52 What does this "redirect1 || 'follow'" mean?
shiva.jm 2015/05/25 12:01:57 Done.
+ 'Request.redirect should match');
+ request1 = new Request(request1);
+ assert_equals(request1.redirect, redirect1 || 'follow',
yhirano 2015/05/25 06:30:52 ditto
shiva.jm 2015/05/25 12:01:56 Done.
+ 'Request.redirect 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