OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>ServiceWorkerGlobalScope: registration</title> |
| 3 <script src='/resources/testharness.js'></script> |
| 4 <script src='/resources/testharnessreport.js'></script> |
| 5 <script src='../resources/test-helpers.sub.js'></script> |
| 6 <script> |
| 7 |
| 8 promise_test(function(t) { |
| 9 var script = 'resources/registration-attribute-worker.js'; |
| 10 var scope = 'resources/scope/registration-attribute'; |
| 11 |
| 12 return service_worker_unregister_and_register(t, script, scope) |
| 13 .then(function(registration) { |
| 14 return wait_for_state(t, registration.installing, 'activated'); |
| 15 }) |
| 16 .then(function() { return with_iframe(scope); }) |
| 17 .then(function(frame) { |
| 18 var expected_events_seen = [ |
| 19 'updatefound', |
| 20 'install', |
| 21 'statechange(installed)', |
| 22 'statechange(activating)', |
| 23 'activate', |
| 24 'statechange(activated)', |
| 25 'fetch', |
| 26 ]; |
| 27 |
| 28 assert_equals( |
| 29 frame.contentDocument.body.textContent, |
| 30 expected_events_seen.toString(), |
| 31 'Service Worker should respond to fetch'); |
| 32 frame.remove(); |
| 33 return service_worker_unregister_and_done(t, scope); |
| 34 }); |
| 35 }, 'Verify registration attribute on ServiceWorkerGlobalScope'); |
| 36 |
| 37 </script> |
OLD | NEW |