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

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

Issue 2524703002: Introduce Response.redirect attribute and add LayoutTest. (Closed)
Patch Set: 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/script-tests/fetch.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
index 31d97ad4d3f43dcdcb121e5271b9268c3681d0bf..e6f00e2e8e7e500ff01f2484d578d0a526036f0a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/fetch.js
@@ -29,6 +29,7 @@ promise_test(function(t) {
assert_equals(response.headers.get('Content-Type'),
'text/plain;charset=US-ASCII');
assert_equals(size(response.headers), 1);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -68,6 +69,7 @@ promise_test(function(t) {
assert_equals(response.headers.get('Content-Type'),
'text/html;charset=utf-8');
assert_equals(size(response.headers), 1);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -99,6 +101,7 @@ if ('createObjectURL' in URL) {
assert_equals(response.headers.get('Content-Type'), 'text/fox');
assert_equals(response.headers.get('Content-Length'), '3');
assert_equals(size(response.headers), 2);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response), [url]);
@@ -136,6 +139,7 @@ promise_test(function(t) {
.then(function(response) {
assert_equals(response.status, 200);
assert_equals(response.statusText, 'OK');
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -150,6 +154,7 @@ promise_test(function(t) {
.then(function(response) {
assert_equals(response.status, 404);
assert_equals(response.statusText, 'Not Found');
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -176,6 +181,7 @@ promise_test(function(t) {
// serialized with the exclude fragment flag set, otherwise.
assert_equals(response.url,
BASE_ORIGIN + '/fetch/resources/fetch-status.php?status=200');
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -205,6 +211,7 @@ promise_test(function(t) {
'Response\'s url is locationURL');
assert_equals(request.url, redirect_original_url,
'Request\'s url remains the original URL');
+ assert_true(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -230,6 +237,7 @@ promise_test(function(t) {
assert_equals(response.status, 0);
assert_equals(response.type, 'opaqueredirect');
assert_equals(response.url, request.url);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response),
@@ -285,6 +293,7 @@ promise_test(function(test) {
assert_equals(response.status, 200);
assert_equals(response.statusText, 'OK');
assert_equals(response.url, url);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response), [url]);
@@ -301,6 +310,7 @@ promise_test(function(test) {
assert_equals(response.status, 200);
assert_equals(response.statusText, 'OK');
assert_equals(response.url, url);
+ assert_false(response.redirected);
if (self.internals) {
assert_array_equals(
self.internals.getInternalResponseURLList(response), [url]);

Powered by Google App Engine
This is Rietveld 408576698