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.js"></script> |
7 <script> | 7 <script> |
8 | 8 |
9 test(function() { | 9 test(function() { |
10 verifyInterface( | 10 verifyInterface( |
11 'ServiceWorkerContainer', navigator.serviceWorker, | 11 'ServiceWorkerContainer', navigator.serviceWorker, |
12 { | 12 { |
13 register: 'function', | 13 register: 'function', |
14 getRegistration: 'function' | 14 getRegistration: 'function' |
15 }); | 15 }); |
16 }, 'Interfaces and attributes of ServiceWorkerContainer'); | 16 }, 'Interfaces and attributes of ServiceWorkerContainer'); |
17 | 17 |
18 async_test(function(t) { | 18 async_test(function(t) { |
19 var EVENT_HANDLER = 'object'; | 19 var EVENT_HANDLER = 'object'; |
20 var scope = 'resources/scope/interfaces-and-attributes'; | 20 var scope = 'scope/interfaces-and-attributes'; |
21 var registration; | 21 var registration; |
22 | 22 |
23 service_worker_unregister_and_register( | 23 service_worker_unregister_and_register( |
24 t, 'resources/empty-worker.js', scope) | 24 t, 'resources/empty-worker.js', scope) |
25 .then(function(r) { | 25 .then(function(r) { |
26 registration = r; | 26 registration = r; |
27 verifyInterface( | 27 verifyInterface( |
28 'ServiceWorkerRegistration', registration, | 28 'ServiceWorkerRegistration', registration, |
29 { | 29 { |
30 installing: 'object', | 30 installing: 'object', |
(...skipping 20 matching lines...) Expand all Loading... |
51 t.done(); | 51 t.done(); |
52 }) | 52 }) |
53 .catch(unreached_rejection(t)); | 53 .catch(unreached_rejection(t)); |
54 }, 'Interfaces and attributes of ServiceWorker'); | 54 }, 'Interfaces and attributes of ServiceWorker'); |
55 | 55 |
56 service_worker_test( | 56 service_worker_test( |
57 'resources/interfaces-worker.js', | 57 'resources/interfaces-worker.js', |
58 'Interfaces and attributes in ServiceWorkerGlobalScope'); | 58 'Interfaces and attributes in ServiceWorkerGlobalScope'); |
59 | 59 |
60 </script> | 60 </script> |
OLD | NEW |