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

Side by Side Diff: LayoutTests/http/tests/serviceworker/activation-after-registration.html

Issue 354953002: Promisify Service Worker test unregister_and_register helper function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/controller-on-load.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: Activation occurs after registration</title> 2 <title>Service Worker: Activation occurs after registration</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script> 5 <script src="resources/test-helpers.js"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 var t = async_test('activation occurs after registration'); 8 var t = async_test('activation occurs after registration');
9 t.step(function() { 9 t.step(function() {
10 var scope = 'resources/blank.html'; 10 var scope = 'resources/blank.html';
11 service_worker_unregister_and_register( 11 service_worker_unregister_and_register(
12 t, 'resources/worker-no-op.js', scope, onRegister); 12 t, 'resources/worker-no-op.js', scope).then(t.step_func(onRegister));
13 13
14 function onRegister(worker) { 14 function onRegister(worker) {
15 assert_equals(worker.state, 'parsed', 'worker should be in the "parsed" state upon registration'); 15 assert_equals(worker.state, 'parsed', 'worker should be in the "parsed" state upon registration');
16 worker.addEventListener('statechange', t.step_func(function(event) { 16 worker.addEventListener('statechange', t.step_func(function(event) {
17 if (event.target.state == 'active') 17 if (event.target.state == 'active')
18 service_worker_unregister_and_done(t, scope); 18 service_worker_unregister_and_done(t, scope);
19 })); 19 }));
20 } 20 }
21 }); 21 });
22 </script> 22 </script>
23 </body> 23 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/controller-on-load.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698