OLD | NEW |
(Empty) | |
| 1 importScripts('../../resources/test-helpers.js'); |
| 2 importScripts('../../resources/worker-testharness.js'); |
| 3 |
| 4 assert_equals( |
| 5 self.registration.scope, |
| 6 normalizeURL('scope/registration-attribute'), |
| 7 'On worker script evaluation, registration attribute should be set'); |
| 8 assert_equals( |
| 9 self.registration.installing, |
| 10 null, |
| 11 'On worker script evaluation, installing worker should be null'); |
| 12 assert_equals( |
| 13 self.registration.waiting, |
| 14 null, |
| 15 'On worker script evaluation, waiting worker should be null'); |
| 16 assert_equals( |
| 17 self.registration.active, |
| 18 null, |
| 19 'On worker script evaluation, active worker should be null'); |
| 20 |
| 21 self.addEventListener('install', function(e) { |
| 22 assert_equals( |
| 23 self.registration.scope, |
| 24 normalizeURL('scope/registration-attribute'), |
| 25 'On install event, registration attribute should be set'); |
| 26 // FIXME: Verify that registration.installing is set. |
| 27 // FIXME: Verify that registration.{waiting, active} are null. |
| 28 }); |
| 29 |
| 30 self.addEventListener('activate', function(e) { |
| 31 assert_equals( |
| 32 self.registration.scope, |
| 33 normalizeURL('scope/registration-attribute'), |
| 34 'On activate event, registration attribute should be set'); |
| 35 // FIXME: Verify that registration.{installing, waiting} are null. |
| 36 // FIXME: Verify that registration.active is set. |
| 37 }); |
| 38 |
| 39 self.addEventListener('fetch', function(e) { |
| 40 assert_equals( |
| 41 self.registration.scope, |
| 42 normalizeURL('scope/registration-attribute'), |
| 43 'On fetch event, registration attribute should be set'); |
| 44 // FIXME: Verify that registration.{installing, waiting} are null. |
| 45 // FIXME: Verify that registration.active is set. |
| 46 e.respondWith(new Response('Hello, world!')); |
| 47 }); |
OLD | NEW |