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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/activation.html

Issue 2190853003: ServiceWorker: Unregister SW after finishing activation.html (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>service worker: activation</title> 3 <title>service worker: activation</title>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 <script src="resources/test-helpers.js"></script> 6 <script src="resources/test-helpers.js"></script>
7 <script> 7 <script>
8 8
9 // Registers, waits for activation, then unregisters on a dummy scope. 9 // Registers, waits for activation, then unregisters on a dummy scope.
10 // 10 //
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 return with_iframe(scope); 45 return with_iframe(scope);
46 }) 46 })
47 .then(f => { 47 .then(f => {
48 iframe = f; 48 iframe = f;
49 49
50 // Create an active worker. 50 // Create an active worker.
51 return navigator.serviceWorker.register(worker_url, { scope: scope }); 51 return navigator.serviceWorker.register(worker_url, { scope: scope });
52 }) 52 })
53 .then(r => { 53 .then(r => {
54 registration = r; 54 registration = r;
55 add_result_callback(() => registration.unregister); 55 add_result_callback(() => registration.unregister());
56 56
57 return wait_for_state(t, r.installing, 'activated'); 57 return wait_for_state(t, r.installing, 'activated');
58 }) 58 })
59 .then(() => { 59 .then(() => {
60 // Check that the frame was claimed. 60 // Check that the frame was claimed.
61 assert_not_equals( 61 assert_not_equals(
62 iframe.contentWindow.navigator.serviceWorker.controller, null); 62 iframe.contentWindow.navigator.serviceWorker.controller, null);
63 63
64 // Create an in-flight request. 64 // Create an in-flight request.
65 registration.active.postMessage('wait'); 65 registration.active.postMessage('wait');
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 new_worker = registration.waiting; 156 new_worker = registration.waiting;
157 var reached_active = wait_for_state(t, new_worker, 'activating'); 157 var reached_active = wait_for_state(t, new_worker, 'activating');
158 registration.active.postMessage('go'); 158 registration.active.postMessage('go');
159 return reached_active; 159 return reached_active;
160 }) 160 })
161 .then(() => { 161 .then(() => {
162 assert_equals(registration.active, new_worker); 162 assert_equals(registration.active, new_worker);
163 }); 163 });
164 }, 'skipWaiting bypasses no controllee requirement'); 164 }, 'skipWaiting bypasses no controllee requirement');
165 </script> 165 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698