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

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

Issue 517223002: ServiceWorker: Tweak layout tests based on the latest install sequence (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 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 <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 var registration; 11 var registration;
12 12
13 service_worker_unregister_and_register( 13 service_worker_unregister_and_register(
14 t, 'resources/empty-worker.js', scope) 14 t, 'resources/empty-worker.js', scope)
15 .then(t.step_func(function(r) { 15 .then(function(r) {
16 registration = r; 16 registration = r;
17 return wait_for_update(t, registration); 17 return wait_for_update(t, registration);
18 })) 18 })
19 .then(t.step_func(function(worker) { 19 .then(function(worker) {
20 assert_equals(worker.state, 'parsed', 'worker should be in the "parsed " state upon registration'); 20 assert_equals(
21 worker.addEventListener('statechange', t.step_func(function(event) { 21 worker.state,
22 if (event.target.state == 'activated') 22 'installing',
23 service_worker_unregister_and_done(t, scope); 23 'worker should be in the "installing" state upon registration');
24 })); 24 return wait_for_state(t, worker, 'activated');
25 })) 25 })
26 .then(function() {
27 service_worker_unregister_and_done(t, scope);
28 })
26 .catch(unreached_rejection(t)); 29 .catch(unreached_rejection(t));
27 }); 30 });
28 </script> 31 </script>
29 </body> 32 </body>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/serviceworker/install-phase-event-waituntil.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698