OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: the fallback behavior of FetchEvent</title> | 2 <title>Service Worker: the fallback behavior of FetchEvent</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?pipe=sub"></script> | 6 <script src="resources/test-helpers.sub.js?pipe=sub"></script> |
7 <script> | 7 <script> |
8 var expected_urls = []; | 8 var expected_urls = []; |
9 | 9 |
10 function xhr_fail_test(frame, url) { | 10 function xhr_fail_test(frame, url) { |
11 expected_urls.push(url); | 11 expected_urls.push(url); |
12 return new Promise(function(resolve, reject) { | 12 return new Promise(function(resolve, reject) { |
13 frame.contentWindow.xhr(url) | 13 frame.contentWindow.xhr(url) |
14 .then(function(){ | 14 .then(function(){ |
15 reject(url + ' should fail.'); | 15 reject(url + ' should fail.'); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 'to the ServiceWorker must be correct.'); | 104 'to the ServiceWorker must be correct.'); |
105 assert_equals(requests[i + 1].mode, 'cors', | 105 assert_equals(requests[i + 1].mode, 'cors', |
106 'The mode of the request which was passed from XHR ' + | 106 'The mode of the request which was passed from XHR ' + |
107 'to the ServiceWorker must be cors.'); | 107 'to the ServiceWorker must be cors.'); |
108 } | 108 } |
109 service_worker_unregister_and_done(t, SCOPE); | 109 service_worker_unregister_and_done(t, SCOPE); |
110 }) | 110 }) |
111 .catch(unreached_rejection(t)); | 111 .catch(unreached_rejection(t)); |
112 }, 'Verify the fallback behavior of FetchEvent'); | 112 }, 'Verify the fallback behavior of FetchEvent'); |
113 </script> | 113 </script> |
OLD | NEW |