2 <title>ServiceWorker: navigator.serviceWorker.waiting
</title>
3 <script src=
"../resources/testharness.js"></script>
4 <script src=
"../resources/testharnessreport.js"></script>
5 <script src=
"resources/test-helpers.js"></script>
9 async_test(function(t
) {
10 var step
= t
.step_func
.bind(t
);
11 var url
= 'resources/empty-worker.js';
12 var scope
= 'resources/blank.html';
16 service_worker_unregister(t
, scope
)
17 .then(function() { return with_iframe(scope
); })
20 return navigator
.serviceWorker
.register(url
, {scope
: scope
});
24 return wait_for_state(t
, r
.installing
, 'installed');
25 }, unreached_rejection(t
, 'Registration should not fail'))
27 var controller
= frame
.contentWindow
.navigator
.serviceWorker
.controller
;
28 assert_equals(controller
, null);
29 assert_equals(registration
.active
, null);
30 assert_equals(registration
.waiting
.scriptURL
, normalizeURL(url
));
31 assert_equals(registration
.installing
, null);
33 // FIXME: Add a test for a frame created after installation.
34 // Should the existing frame ("frame") block activation?
38 return service_worker_unregister_and_done(t
, scope
);