2 <title>Service Worker: Register wait-forever-in-install-worker
</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 bad_script
= 'resources/wait-forever-in-install-worker.js';
11 var good_script
= 'resources/empty-worker.js';
12 var scope
= 'resources/wait-forever-in-install-worker';
13 return navigator
.serviceWorker
.register(bad_script
, {scope
: scope
})
14 .then(function(registration
) {
15 assert_equals(registration
.installing
.scriptURL
,
16 normalizeURL(bad_script
));
17 return navigator
.serviceWorker
.register(good_script
, {scope
: scope
});
19 .then(function(registration
) {
20 assert_equals(registration
.installing
.scriptURL
,
21 normalizeURL(good_script
));
22 return wait_for_state(t
, registration
.installing
, 'activated');
25 return service_worker_unregister_and_done(t
, scope
);
27 }, 'register worker that calls waitUntil with a promise that never ' +
28 'resolves in oninstall');