OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <title>Service Worker: Interfaces</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="resources/interfaces.js"></script> | |
6 <script src="resources/test-helpers.js"></script> | |
7 <script> | |
8 | |
9 test(function() { | |
10 var EVENT_HANDLER = 'object'; | |
11 verify_interface( | |
12 'ServiceWorkerContainer', navigator.serviceWorker, | |
13 { | |
14 register: 'function', | |
15 getRegistration: 'function', | |
16 oncontrollerchange: EVENT_HANDLER, | |
17 onmessage: EVENT_HANDLER | |
18 }); | |
19 }, 'Interfaces and attributes of ServiceWorkerContainer'); | |
20 | |
21 async_test(function(t) { | |
22 var EVENT_HANDLER = 'object'; | |
23 var scope = 'resources/scope/interfaces-and-attributes'; | |
24 | |
25 service_worker_unregister_and_register( | |
26 t, 'resources/empty-worker.js', scope) | |
27 .then(function(registration) { | |
28 verify_interface( | |
29 'ServiceWorkerRegistration', registration, | |
30 { | |
31 installing: 'object', | |
32 waiting: 'object', | |
33 active: 'object', | |
34 scope: 'string', | |
35 unregister: 'function', | |
36 onupdatefound: EVENT_HANDLER | |
37 }); | |
38 verify_interface( | |
39 'ServiceWorker', registration.installing, | |
40 { | |
41 scriptURL: 'string', | |
42 state: 'string', | |
43 onstatechange: EVENT_HANDLER | |
44 }); | |
45 return registration.unregister(); | |
46 }) | |
47 .then(function() { | |
48 t.done(); | |
49 }) | |
50 .catch(unreached_rejection(t)); | |
51 }, 'Interfaces and attributes of ServiceWorker'); | |
52 | |
53 service_worker_test( | |
54 'resources/interfaces-worker.js', | |
55 'Interfaces and attributes in ServiceWorkerGlobalScope'); | |
56 | |
57 </script> | |
OLD | NEW |