Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.register-wait-forever-in-install-worker.html

Issue 2892473003: Upstream service worker "register" tests to WPT (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- This test is prefixed with `chromium.` because it is maintained only to
3 preserve test coverage until such time as the more rigorous version available
4 in the Web Platform Tests project can be made to pass. See
5 https://crbug.com/723037 -->
2 <title>Service Worker: Register wait-forever-in-install-worker</title> 6 <title>Service Worker: Register wait-forever-in-install-worker</title>
3 <script src="../resources/testharness.js"></script> 7 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 8 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script> 9 <script src="resources/test-helpers.js"></script>
6 <script> 10 <script>
7 11
8 promise_test(function(t) { 12 promise_test(function(t) {
9 var bad_script = 'resources/wait-forever-in-install-worker.js'; 13 var bad_script = 'resources/wait-forever-in-install-worker.js';
10 var good_script = 'resources/empty-worker.js'; 14 var good_script = 'resources/empty-worker.js';
11 var scope = 'resources/wait-forever-in-install-worker'; 15 var scope = 'resources/wait-forever-in-install-worker';
12 return navigator.serviceWorker.register(bad_script, {scope: scope}) 16 return navigator.serviceWorker.register(bad_script, {scope: scope})
13 .then(function(registration) { 17 .then(function(registration) {
14 assert_equals(registration.installing.scriptURL, 18 assert_equals(registration.installing.scriptURL,
15 normalizeURL(bad_script)); 19 normalizeURL(bad_script));
16 return navigator.serviceWorker.register(good_script, {scope: scope}); 20 return navigator.serviceWorker.register(good_script, {scope: scope});
17 }) 21 })
18 .then(function(registration) { 22 .then(function(registration) {
19 assert_equals(registration.installing.scriptURL, 23 assert_equals(registration.installing.scriptURL,
20 normalizeURL(good_script)); 24 normalizeURL(good_script));
21 return wait_for_state(t, registration.installing, 'activated'); 25 return wait_for_state(t, registration.installing, 'activated');
22 }) 26 })
23 .then(function() { 27 .then(function() {
24 return service_worker_unregister_and_done(t, scope); 28 return service_worker_unregister_and_done(t, scope);
25 }) 29 })
26 }, 'register worker that calls waitUntil with a promise that never ' + 30 }, 'register worker that calls waitUntil with a promise that never ' +
27 'resolves in oninstall'); 31 'resolves in oninstall');
28 32
29 </script> 33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698