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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/background_sync/oneshot-register-failure-worker-not-activated.html

Issue 1437883002: [Background Sync] Align exposed API with spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src@remove-periodic
Patch Set: Rebase Created 5 years, 1 month 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 <html> 2 <html>
3 <head> 3 <head>
4 <title>sync.register() is rejected when the service worker is not active yet</ti tle> 4 <title>sync.register() is rejected when the service worker is not active yet</ti tle>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script> 7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
11 async_test(function(test) { 11 async_test(function(test) {
12 var workerUrl = 'resources/empty_worker.js'; 12 var workerUrl = 'resources/empty_worker.js';
13 var workerScope = 'resources/scope/' + location.pathname; 13 var workerScope = 'resources/scope/' + location.pathname;
14 var swRegistration; 14 var swRegistration;
15 service_worker_unregister_and_register(test, workerUrl, workerScope) 15 service_worker_unregister_and_register(test, workerUrl, workerScope)
16 .then(function(serviceWorkerRegistration) { 16 .then(function(serviceWorkerRegistration) {
17 swRegistration = serviceWorkerRegistration; 17 swRegistration = serviceWorkerRegistration;
18 assert_not_equals(swRegistration.installing, null, 'The worker shoul d be installing'); 18 assert_not_equals(swRegistration.installing, null, 'The worker shoul d be installing');
19 assert_equals(swRegistration.active, null, 'The worker should not be active yet'); 19 assert_equals(swRegistration.active, null, 'The worker should not be active yet');
20 return swRegistration.sync.register(); 20 return swRegistration.sync.register('abcde');
21 }) 21 })
22 .then(function(syncRegistration) { 22 .then(function(syncRegistration) {
23 assert_unreached('sync.register() must not succeed without an active service worker'); 23 assert_unreached('sync.register() must not succeed without an active service worker');
24 }, function(e) { 24 }, function(e) {
25 assert_equals(e.name, 'AbortError'); 25 assert_equals(e.name, 'AbortError');
26 assert_equals(e.message, 'Registration failed - no active Service Wo rker'); 26 assert_equals(e.message, 'Registration failed - no active Service Wo rker');
27 return service_worker_unregister_and_done(test, workerScope); 27 return service_worker_unregister_and_done(test, workerScope);
28 }) 28 })
29 .catch(unreached_rejection(test)); 29 .catch(unreached_rejection(test));
30 }, 'sync.register() is rejected when the service worker is not active yet'); 30 }, 'sync.register() is rejected when the service worker is not active yet');
31 </script> 31 </script>
32 </body> 32 </body>
33 </html> 33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698