OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <title>Service Worker: Skip waiting without using registration</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="resources/test-helpers.js"></script> | |
6 <script> | |
7 | |
8 promise_test(function(t) { | |
9 var scope = 'resources/blank.html'; | |
10 var url = 'resources/skip-waiting-worker.js'; | |
11 var frame, frame_sw, sw_registration; | |
12 | |
13 return service_worker_unregister(t, scope) | |
14 .then(function() { | |
15 return with_iframe(scope); | |
16 }) | |
17 .then(function(f) { | |
18 frame = f; | |
19 frame_sw = f.contentWindow.navigator.serviceWorker; | |
20 assert_equals(frame_sw.controller, null, | |
21 'Document controller should be null'); | |
22 return navigator.serviceWorker.register(url, {scope: scope}); | |
23 }) | |
24 .then(function(registration) { | |
25 sw_registration = registration; | |
26 add_completion_callback(function() { | |
27 registration.unregister(); | |
28 }); | |
29 return wait_for_state(t, registration.installing, 'activated'); | |
30 }) | |
31 .then(function() { | |
32 assert_equals(frame_sw.controller, null, | |
33 'Document controller should still be null'); | |
34 assert_not_equals(sw_registration.active, null, | |
35 'Registration active worker should not be null'); | |
36 fetch_tests_from_worker(sw_registration.active); | |
37 frame.remove(); | |
38 }); | |
39 }, 'Test skipWaiting while a client is not being controlled'); | |
40 | |
41 </script> | |
OLD | NEW |