OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: fetch()</title> | 2 <title>Service Worker: Body mixin</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"></script> | 5 <script src="resources/test-helpers.js"></script> |
6 <script> | 6 <script> |
7 async_test(function(t) { | 7 async_test(function(t) { |
8 var scope = 'resources/blank.html'; | 8 var scope = 'resources/blank.html'; |
9 service_worker_unregister_and_register( | 9 service_worker_unregister_and_register( |
10 t, 'resources/fetch-body-stream-worker.js', scope) | 10 t, 'resources/fetch-body-mixin-worker.js', scope) |
11 .then(function(registration) { | 11 .then(function(registration) { |
12 return wait_for_update(t, registration); | 12 return wait_for_update(t, registration); |
13 }) | 13 }) |
14 .then(function(sw) { | 14 .then(function(sw) { |
15 var messageChannel = new MessageChannel(); | 15 var messageChannel = new MessageChannel(); |
16 messageChannel.port1.onmessage = t.step_func(onMessage); | 16 messageChannel.port1.onmessage = t.step_func(onMessage); |
17 sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]); | 17 sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]); |
18 }) | 18 }) |
19 .catch(unreached_rejection(t)); | 19 .catch(unreached_rejection(t)); |
20 | 20 |
(...skipping 12 matching lines...) Expand all Loading... |
33 if (message == 'quit') { | 33 if (message == 'quit') { |
34 assert_array_equals(result, expected, | 34 assert_array_equals(result, expected, |
35 'Worker should post back expected values.'); | 35 'Worker should post back expected values.'); |
36 service_worker_unregister_and_done(t, scope); | 36 service_worker_unregister_and_done(t, scope); |
37 } else { | 37 } else { |
38 result.push(message); | 38 result.push(message); |
39 } | 39 } |
40 } | 40 } |
41 }, 'Verify FetchBodyStream in a Service Worker'); | 41 }, 'Verify FetchBodyStream in a Service Worker'); |
42 </script> | 42 </script> |
OLD | NEW |