OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: FetchEvent for resources</title> | 2 <title>Service Worker: FetchEvent for resources</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/test-helpers.js?pipe=sub"></script> | 5 <script src="resources/test-helpers.js?pipe=sub"></script> |
6 <script> | 6 <script> |
7 var url_count = 0; | 7 var url_count = 0; |
8 var expected_results = {}; | 8 var expected_results = {}; |
9 | 9 |
10 function image_test(frame, url, cross_origin, | 10 function image_test(frame, url, cross_origin, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 var SCRIPT = 'resources/fetch-request-resources-worker.js'; | 85 var SCRIPT = 'resources/fetch-request-resources-worker.js'; |
86 var host_info = get_host_info(); | 86 var host_info = get_host_info(); |
87 var LOCAL_URL = | 87 var LOCAL_URL = |
88 host_info['HTTP_ORIGIN'] + base_path() + 'resources/dummy?test'; | 88 host_info['HTTP_ORIGIN'] + base_path() + 'resources/dummy?test'; |
89 var REMOTE_URL = | 89 var REMOTE_URL = |
90 host_info['HTTP_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test'; | 90 host_info['HTTP_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test'; |
91 var worker; | 91 var worker; |
92 var frame; | 92 var frame; |
93 service_worker_unregister_and_register(t, SCRIPT, SCOPE) | 93 service_worker_unregister_and_register(t, SCRIPT, SCOPE) |
94 .then(function(registration) { | 94 .then(function(registration) { |
95 return wait_for_update(t, registration); | 95 worker = registration.installing; |
96 }) | 96 return wait_for_state(t, worker, 'activated'); |
97 .then(function(sw) { | |
98 worker = sw; | |
99 return wait_for_state(t, sw, 'activated'); | |
100 }) | 97 }) |
101 .then(function() { | 98 .then(function() { |
102 return new Promise(function(resolve) { | 99 return new Promise(function(resolve) { |
103 var channel = new MessageChannel(); | 100 var channel = new MessageChannel(); |
104 channel.port1.onmessage = t.step_func(function(msg) { | 101 channel.port1.onmessage = t.step_func(function(msg) { |
105 if (msg.data.ready) { | 102 if (msg.data.ready) { |
106 resolve(); | 103 resolve(); |
107 return; | 104 return; |
108 } | 105 } |
109 var result = msg.data; | 106 var result = msg.data; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 'no-cors', 'same-origin'); | 165 'no-cors', 'same-origin'); |
169 css_image_set_test(f, REMOTE_URL, 'backgroundImage', | 166 css_image_set_test(f, REMOTE_URL, 'backgroundImage', |
170 'no-cors', 'same-origin'); | 167 'no-cors', 'same-origin'); |
171 css_image_set_test(f, LOCAL_URL, 'shapeOutside', 'cors', 'omit'); | 168 css_image_set_test(f, LOCAL_URL, 'shapeOutside', 'cors', 'omit'); |
172 css_image_set_test(f, REMOTE_URL, 'shapeOutside', 'cors', 'omit'); | 169 css_image_set_test(f, REMOTE_URL, 'shapeOutside', 'cors', 'omit'); |
173 | 170 |
174 }) | 171 }) |
175 .catch(unreached_rejection(t)); | 172 .catch(unreached_rejection(t)); |
176 }, 'Verify FetchEvent for resources.'); | 173 }, 'Verify FetchEvent for resources.'); |
177 </script> | 174 </script> |
OLD | NEW |