OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: registration events</title> | 2 <title>Service Worker: registration events</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.sub.js"></script> |
6 <script> | 6 <script> |
7 var t = async_test('Registration: events'); | 7 var t = async_test('Registration: events'); |
8 t.step(function() { | 8 t.step(function() { |
9 var scope = 'resources/in-scope/'; | 9 var scope = 'resources/in-scope/'; |
10 service_worker_unregister_and_register( | 10 service_worker_unregister_and_register( |
11 t, 'resources/events-worker.js', scope) | 11 t, 'resources/events-worker.js', scope) |
12 .then(t.step_func(function(registration) { | 12 .then(t.step_func(function(registration) { |
13 onRegister(registration.installing); | 13 onRegister(registration.installing); |
14 })) | 14 })) |
15 .catch(unreached_rejection(t)); | 15 .catch(unreached_rejection(t)); |
(...skipping 12 matching lines...) Expand all Loading... |
28 sendMessagePort(sw, 'registering doc').onmessage = t.step_func(funct
ion (e) { | 28 sendMessagePort(sw, 'registering doc').onmessage = t.step_func(funct
ion (e) { |
29 assert_array_equals(e.data.events, | 29 assert_array_equals(e.data.events, |
30 ['install', 'activate'], | 30 ['install', 'activate'], |
31 'Worker should see install then activate even
ts'); | 31 'Worker should see install then activate even
ts'); |
32 service_worker_unregister_and_done(t, scope); | 32 service_worker_unregister_and_done(t, scope); |
33 }); | 33 }); |
34 }); | 34 }); |
35 } | 35 } |
36 }); | 36 }); |
37 </script> | 37 </script> |
OLD | NEW |