OLD | NEW |
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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('))); | 239 .then(response_text => assert_true(response_text.startsWith('report('))); |
240 }, 'Service Worker does not intercept fetches with CORS preflight'); | 240 }, 'Service Worker does not intercept fetches with CORS preflight'); |
241 | 241 |
| 242 promise_test(t => { |
| 243 var scope = 'simple.txt?null'; |
| 244 var remote_url = |
| 245 host_info.HTTPS_REMOTE_ORIGIN + '/serviceworker/resources/' + scope; |
| 246 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) |
| 247 .then(() => promise_rejects(t, new TypeError(), fetch(remote_url))); |
| 248 }, 'Foreign fetch rejects if resolved with a null response.'); |
242 </script> | 249 </script> |
243 </body> | 250 </body> |
OLD | NEW |