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