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>
11 'ServiceWorkerContainer', navigator.serviceWorker,
14 getRegistration: 'function'
16 }, 'Interfaces and attributes of ServiceWorkerContainer');
18 async_test(function(t) {
19 var EVENT_HANDLER = 'object';
20 var scope = 'scope/interfaces-and-attributes';
23 service_worker_unregister_and_register(
24 t, 'resources/empty-worker.js', scope)
28 'ServiceWorkerRegistration', registration,
34 unregister: 'function',
35 onupdatefound: EVENT_HANDLER
37 return wait_for_update(t, registration);
39 .then(function(worker) {
41 'ServiceWorker', worker,
45 terminate: 'function',
46 onstatechange: EVENT_HANDLER
48 return registration.unregister();
53 .catch(unreached_rejection(t));
54 }, 'Interfaces and attributes of ServiceWorker');
57 'resources/interfaces-worker.js',
58 'Interfaces and attributes in ServiceWorkerGlobalScope');