| <!DOCTYPE html> |
| <!-- This test is prefixed with `chromium.` because it is maintained only to |
| preserve test coverage until such time as the more rigorous version available |
| in the Web Platform Tests project can be made to pass. See |
| https://crbug.com/723037 --> |
| <title>Service Worker: Register wait-forever-in-install-worker</title> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="resources/test-helpers.js"></script> |
| <script> |
| |
| promise_test(function(t) { |
| var bad_script = 'resources/wait-forever-in-install-worker.js'; |
| var good_script = 'resources/empty-worker.js'; |
| var scope = 'resources/wait-forever-in-install-worker'; |
| return navigator.serviceWorker.register(bad_script, {scope: scope}) |
| .then(function(registration) { |
| assert_equals(registration.installing.scriptURL, |
| normalizeURL(bad_script)); |
| return navigator.serviceWorker.register(good_script, {scope: scope}); |
| }) |
| .then(function(registration) { |
| assert_equals(registration.installing.scriptURL, |
| normalizeURL(good_script)); |
| return wait_for_state(t, registration.installing, 'activated'); |
| }) |
| .then(function() { |
| return service_worker_unregister_and_done(t, scope); |
| }) |
| }, 'register worker that calls waitUntil with a promise that never ' + |
| 'resolves in oninstall'); |
| |
| </script> |