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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/foreign-fetch-basics.html

Issue 2582833002: Fix foreign fetch intercepting CORS preflighted requests if preflight was in cache. (Closed)
Patch Set: address comments Created 3 years, 12 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/get-host-info.js"></script> 4 <script src="../resources/get-host-info.js"></script>
5 <script src="resources/test-helpers.js"></script> 5 <script src="resources/test-helpers.js"></script>
6 <script src="resources/foreign-fetch-helpers.js"></script> 6 <script src="resources/foreign-fetch-helpers.js"></script>
7 <body> 7 <body>
8 <script> 8 <script>
9 var host_info = get_host_info(); 9 var host_info = get_host_info();
10 10
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 'Error: TypeError: Failed to fetch')); 229 'Error: TypeError: Failed to fetch'));
230 }, 'Service Worker does not intercept fetches from an insecure context.'); 230 }, 'Service Worker does not intercept fetches from an insecure context.');
231 231
232 promise_test(t => { 232 promise_test(t => {
233 var scope = 'fetch-access-control.php?basic&ACAOrigin=*&ACAMethods=SPECIAL'; 233 var scope = 'fetch-access-control.php?basic&ACAOrigin=*&ACAMethods=SPECIAL';
234 var remote_url = 234 var remote_url =
235 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope; 235 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
236 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) 236 return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
237 .then(() => fetch(remote_url, {method: 'SPECIAL'})) 237 .then(() => fetch(remote_url, {method: 'SPECIAL'}))
238 .then(response => response.text()) 238 .then(response => response.text())
239 .then(response_text => assert_true(response_text.startsWith('report(')))
240 // Do the whole thing twice to test CORS preflight cache behavior.
241 .then(() => fetch(remote_url, {method: 'SPECIAL'}))
242 .then(response => response.text())
239 .then(response_text => assert_true(response_text.startsWith('report('))); 243 .then(response_text => assert_true(response_text.startsWith('report(')));
240 }, 'Service Worker does not intercept fetches with CORS preflight'); 244 }, 'Service Worker does not intercept fetches with CORS preflight');
241 245
242 promise_test(t => { 246 promise_test(t => {
243 var scope = 'simple.txt?null'; 247 var scope = 'simple.txt?null';
244 var remote_url = 248 var remote_url =
245 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope; 249 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope;
246 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) 250 return install_cross_origin_worker(t, worker_for_scopes(['']), scope)
247 .then(() => promise_rejects(t, new TypeError(), fetch(remote_url))); 251 .then(() => promise_rejects(t, new TypeError(), fetch(remote_url)));
248 }, 'Foreign fetch rejects if resolved with a null response.'); 252 }, 'Foreign fetch rejects if resolved with a null response.');
249 </script> 253 </script>
250 </body> 254 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698