OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: basic Foreign Fetch functionality</title> | 2 <title>Service Worker: basic Foreign Fetch functionality</title> |
3 <script src="/resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
4 <script src="/resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
5 <script src="resources/get-host-info.sub.js"></script> | 5 <script src="/common/get-host-info.sub.js"></script> |
6 <script src="resources/test-helpers.sub.js"></script> | 6 <script src="resources/test-helpers.sub.js"></script> |
7 <script src="resources/foreign-fetch-helpers.js"></script> | 7 <script src="resources/foreign-fetch-helpers.js"></script> |
8 <body> | 8 <body> |
9 <script> | 9 <script> |
10 var host_info = get_host_info(); | 10 var host_info = get_host_info(); |
11 var resource_path = new URL('resources/', location).pathname; | 11 var resource_path = new URL('resources/', location).pathname; |
12 | 12 |
13 function worker_for_origins(origins) { | 13 function worker_for_origins(origins) { |
14 var worker = 'foreign-fetch-worker.js?'; | 14 var worker = 'foreign-fetch-worker.js?'; |
15 var params = {origins: origins, relscopes: ['/intercept']}; | 15 var params = {origins: origins, relscopes: ['/intercept']}; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 promise_test(t => { | 233 promise_test(t => { |
234 var scope = 'simple.txt?null'; | 234 var scope = 'simple.txt?null'; |
235 var remote_url = | 235 var remote_url = |
236 host_info.HTTPS_REMOTE_ORIGIN + resource_path + scope; | 236 host_info.HTTPS_REMOTE_ORIGIN + resource_path + scope; |
237 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) | 237 return install_cross_origin_worker(t, worker_for_scopes(['']), scope) |
238 .then(() => promise_rejects(t, new TypeError(), fetch(remote_url))); | 238 .then(() => promise_rejects(t, new TypeError(), fetch(remote_url))); |
239 }, 'Foreign fetch rejects if resolved with a null response.'); | 239 }, 'Foreign fetch rejects if resolved with a null response.'); |
240 </script> | 240 </script> |
241 </body> | 241 </body> |
OLD | NEW |