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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/thorough/cors-preflight2.js

Issue 2633423003: Leave out empty-valued Access-Control-Request-Headers: on preflights. (Closed)
Patch Set: sync unit tests Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('/fetch/resources/fetch-test-helpers.js'); 2 importScripts('/fetch/resources/fetch-test-helpers.js');
3 importScripts('/fetch/resources/thorough-util.js'); 3 importScripts('/fetch/resources/thorough-util.js');
4 } 4 }
5 5
6 // Tests for CORS preflight fetch (non-simple methods). 6 // Tests for CORS preflight fetch (non-simple methods).
7 // Spec: https://fetch.spec.whatwg.org/#cors-preflight-fetch 7 // Spec: https://fetch.spec.whatwg.org/#cors-preflight-fetch
8 8
9 var TEST_TARGETS = []; 9 var TEST_TARGETS = [];
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 '&PACAHeaders=x-servicewOrker-test&PreflightTest=200', 160 '&PACAHeaders=x-servicewOrker-test&PreflightTest=200',
161 [fetchRejected]], 161 [fetchRejected]],
162 162
163 // Test request headers sent in CORS preflight requests. 163 // Test request headers sent in CORS preflight requests.
164 [OTHER_BASE_URL + 'mode=cors&credentials=same-origin&method=' + method + 164 [OTHER_BASE_URL + 'mode=cors&credentials=same-origin&method=' + method +
165 '&headers=CUSTOM&ACAOrigin=*&PACAOrigin=*&PACAMethods=' + method + 165 '&headers=CUSTOM&ACAOrigin=*&PACAOrigin=*&PACAMethods=' + method +
166 '&PACAHeaders=x-serviceworker-test&PACRMethod=' + method + 166 '&PACAHeaders=x-serviceworker-test&PACRMethod=' + method +
167 '&PACRHeaders=x-serviceworker-test&PreflightTest=200', 167 '&PACRHeaders=x-serviceworker-test&PreflightTest=200',
168 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], 168 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
169 [checkMethod, hasCustomHeader]], 169 [checkMethod, hasCustomHeader]],
170
171 // Verify that Access-Control-Request-Headers: is not present in preflight
172 // if its value is the empty list - https://crbug.com/633729
173 [OTHER_BASE_URL + 'mode=cors&credentials=same-origin&method=' + method +
174 '&ACAOrigin=*&PACAOrigin=*&PACAMethods=' + method +
175 '&PACRHeaders=missing&PACRMethod=' + method + '&PreflightTest=200',
176 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
177 [checkMethod]],
tyoshino (SeeGerritForStatus) 2017/01/18 06:00:29 This test is ok to have, but what we should test i
sof 2017/01/18 06:26:49 You mean explicitly furnishing the request with a
tyoshino (SeeGerritForStatus) 2017/01/18 06:49:02 Right. Even before this fix, we skipped the Access
sof 2017/01/18 06:57:48 ok, that code path was already being exercised by
178
170 // Test Access-Control-Request-Headers is sorted https://crbug.com/452391 179 // Test Access-Control-Request-Headers is sorted https://crbug.com/452391
171 [OTHER_BASE_URL + 'mode=cors&credentials=same-origin&method=' + method + 180 [OTHER_BASE_URL + 'mode=cors&credentials=same-origin&method=' + method +
172 '&headers=CUSTOM2&ACAOrigin=*&PACAOrigin=*&PACAMethods=' + method + 181 '&headers=CUSTOM2&ACAOrigin=*&PACAOrigin=*&PACAMethods=' + method +
173 '&PACAHeaders=x-servicEworker-u,x-servicEworker-ua,x-servicewOrker-test,x -sErviceworker-s,x-sErviceworker-v&PACRMethod=' + method + 182 '&PACAHeaders=x-servicEworker-u,x-servicEworker-ua,x-servicewOrker-test,x -sErviceworker-s,x-sErviceworker-v&PACRMethod=' + method +
174 '&PACRHeaders=x-serviceworker-s,x-serviceworker-test,x-serviceworker-u,x- serviceworker-ua,x-serviceworker-v&PreflightTest=200', 183 '&PACRHeaders=x-serviceworker-s,x-serviceworker-test,x-serviceworker-u,x- serviceworker-ua,x-serviceworker-v&PreflightTest=200',
175 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], 184 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors],
176 [checkMethod, hasCustomHeader2]]); 185 [checkMethod, hasCustomHeader2]]);
177 }); 186 });
178 187
179 if (self.importScripts) { 188 if (self.importScripts) {
180 executeTests(TEST_TARGETS); 189 executeTests(TEST_TARGETS);
181 done(); 190 done();
182 } 191 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698