OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Service Worker: Interfaces</title> | 2 <title>Service Worker: Interfaces</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/interfaces.js"></script> | 5 <script src="resources/interfaces.js"></script> |
6 <script src="resources/test-helpers.js"></script> | 6 <script src="resources/test-helpers.sub.js"></script> |
7 <script> | 7 <script> |
8 | 8 |
9 test(function() { | 9 test(function() { |
10 var EVENT_HANDLER = 'object'; | 10 var EVENT_HANDLER = 'object'; |
11 verify_interface( | 11 verify_interface( |
12 'ServiceWorkerContainer', navigator.serviceWorker, | 12 'ServiceWorkerContainer', navigator.serviceWorker, |
13 { | 13 { |
14 register: 'function', | 14 register: 'function', |
15 getRegistration: 'function', | 15 getRegistration: 'function', |
16 oncontrollerchange: EVENT_HANDLER, | 16 oncontrollerchange: EVENT_HANDLER |
17 onmessage: EVENT_HANDLER | |
18 }); | 17 }); |
19 }, 'Interfaces and attributes of ServiceWorkerContainer'); | 18 }, 'Interfaces and attributes of ServiceWorkerContainer'); |
20 | 19 |
21 async_test(function(t) { | 20 async_test(function(t) { |
22 var EVENT_HANDLER = 'object'; | 21 var EVENT_HANDLER = 'object'; |
23 var scope = 'resources/scope/interfaces-and-attributes'; | 22 var scope = 'resources/scope/interfaces-and-attributes'; |
24 | 23 |
25 service_worker_unregister_and_register( | 24 service_worker_unregister_and_register( |
26 t, 'resources/empty-worker.js', scope) | 25 t, 'resources/empty-worker.js', scope) |
27 .then(function(registration) { | 26 .then(function(registration) { |
(...skipping 16 matching lines...) Expand all Loading... |
44 }); | 43 }); |
45 return registration.unregister(); | 44 return registration.unregister(); |
46 }) | 45 }) |
47 .then(function() { | 46 .then(function() { |
48 t.done(); | 47 t.done(); |
49 }) | 48 }) |
50 .catch(unreached_rejection(t)); | 49 .catch(unreached_rejection(t)); |
51 }, 'Interfaces and attributes of ServiceWorker'); | 50 }, 'Interfaces and attributes of ServiceWorker'); |
52 | 51 |
53 service_worker_test( | 52 service_worker_test( |
54 'resources/interfaces-worker.js', | 53 'resources/interfaces-worker.sub.js', |
55 'Interfaces and attributes in ServiceWorkerGlobalScope'); | 54 'Interfaces and attributes in ServiceWorkerGlobalScope'); |
56 | 55 |
57 </script> | 56 </script> |
OLD | NEW |