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.sub.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 onmessageerror: EVENT_HANDLER | |
19 }); | |
20 }, 'Interfaces and attributes of ServiceWorkerContainer'); | |
21 | |
22 async_test(function(t) { | |
23 var EVENT_HANDLER = 'object'; | |
24 var scope = 'resources/scope/interfaces-and-attributes'; | |
25 | |
26 service_worker_unregister_and_register( | |
27 t, 'resources/empty-worker.js', scope) | |
28 .then(function(registration) { | |
29 verify_interface( | |
30 'ServiceWorkerRegistration', registration, | |
31 { | |
32 installing: 'object', | |
33 waiting: 'object', | |
34 active: 'object', | |
35 scope: 'string', | |
36 unregister: 'function', | |
37 onupdatefound: EVENT_HANDLER | |
38 }); | |
39 verify_interface( | |
40 'ServiceWorker', registration.installing, | |
41 { | |
42 scriptURL: 'string', | |
43 state: 'string', | |
44 onstatechange: EVENT_HANDLER | |
45 }); | |
46 return registration.unregister(); | |
47 }) | |
48 .then(function() { | |
49 t.done(); | |
50 }) | |
51 .catch(unreached_rejection(t)); | |
52 }, 'Interfaces and attributes of ServiceWorker'); | |
53 | |
54 service_worker_test( | |
55 'resources/interfaces-worker.sub.js', | |
56 'Interfaces and attributes in ServiceWorkerGlobalScope'); | |
57 | |
58 </script> | |
OLD | NEW |