| <!DOCTYPE html> |
| <title>Service Worker: Interfaces</title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/resources/WebIDLParser.js"></script> |
| <script src="/resources/idlharness.js"></script> |
| <script src="resources/interfaces-idls.js"></script> |
| <script src="resources/test-helpers.sub.js"></script> |
| <script> |
| 'use strict'; |
| |
| var idlArray = new IdlArray(); |
| idlArray.add_untested_idls(idls.untested); |
| idlArray.add_idls(idls.tested); |
| idlArray.add_objects({ |
| ServiceWorkerContainer: ['navigator.serviceWorker'] |
| }); |
| |
| promise_test(function(t) { |
| var scope = 'resources/scope/interfaces-and-attributes'; |
| |
| return service_worker_unregister_and_register( |
| t, 'resources/empty-worker.js', scope) |
| .then(function(registration) { |
| t.add_cleanup(function() { |
| registration.unregister(); |
| }); |
| |
| window.registrationInstance = registration; |
| idlArray.add_objects({ |
| ServiceWorkerRegistration: ['window.registrationInstance'], |
| ServiceWorker: ['window.registrationInstance.installing'] |
| }); |
| idlArray.test(); |
| }); |
| }, 'test setup (worker registration)'); |
| </script> |