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

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

Issue 1304183006: Fail preflight request when redirect is received (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated expectation 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/fetch.js
diff --git a/LayoutTests/http/tests/fetch/script-tests/fetch.js b/LayoutTests/http/tests/fetch/script-tests/fetch.js
index 239263e0ae8fc78efadc9c9191f871596e3f4039..60974662b01e9fcf195a5b93bcbff316afe1fe4c 100644
--- a/LayoutTests/http/tests/fetch/script-tests/fetch.js
+++ b/LayoutTests/http/tests/fetch/script-tests/fetch.js
@@ -114,6 +114,27 @@ promise_test(function(t) {
promise_test(function(t) {
var redirect_target_url =
+ OTHER_ORIGIN + '/fetch/resources/fetch-status.php?status=200';
+ var redirect_original_url =
+ OTHER_ORIGIN + '/serviceworker/resources/redirect.php?Redirect=' +
+ redirect_target_url;
+
+ var request = new Request(redirect_original_url,
+ {headers: [['X-Fetch-Test', 'A']],
+ redirect: 'manual'});
+
+ // Cross-origin request with non-simple header initiates CORS preflight
+ // request.
+ return fetch(request)
+ .then(
+ t.unreached_func('Even in manual redirect mode, fetch with preflight' +
+ ' must fail when redirect response is received'),
+ function() {});
+ }, 'Even in manual redirect mode, fetch with preflight must fail when' +
+ ' redirect response is received');
+
+promise_test(function(t) {
+ var redirect_target_url =
BASE_ORIGIN + '/fetch/resources/fetch-status.php?status=200';
var redirect_original_url =
BASE_ORIGIN + '/serviceworker/resources/redirect.php?Redirect=' +
@@ -126,10 +147,10 @@ promise_test(function(t) {
return fetch(request)
.then(
- t.unreached_func('Redirect response must cause an error when redirct' +
+ t.unreached_func('Redirect response must cause an error when redirect' +
' mode is error.'),
function() {});
- }, 'Redirect response must cause an error when redirct mode is error.');
+ }, 'Redirect response must cause an error when redirect mode is error.');
promise_test(function(test) {
var url = BASE_ORIGIN + '/fetch/resources/doctype.html';

Powered by Google App Engine
This is Rietveld 408576698