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

Side by Side Diff: LayoutTests/http/tests/serviceworker/controller-on-load.html

Issue 776373003: ServiceWorker cleanup: remove wait_for_update() in favor of r.installing in most tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: Controller on load</title> 2 <title>Service Worker: Controller on load</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('controller is set for a controlled document'); 8 var t = async_test('controller is set for a controlled document');
9 t.step(function() { 9 t.step(function() {
10 var url = 'resources/empty-worker.js'; 10 var url = 'resources/empty-worker.js';
11 var scope = 'resources/blank.html'; 11 var scope = 'resources/blank.html';
12 service_worker_unregister_and_register(t, url, scope) 12 service_worker_unregister_and_register(t, url, scope)
13 .then(t.step_func(function(registration) { 13 .then(t.step_func(function(registration) {
14 return wait_for_update(t, registration); 14 return wait_for_state(t, registration.installing, 'activated');
15 }))
16 .then(t.step_func(function(worker) {
17 return wait_for_state(t, worker, 'activated');
18 })) 15 }))
19 .then(t.step_func(function() { 16 .then(t.step_func(function() {
20 return with_iframe(scope) 17 return with_iframe(scope)
21 })) 18 }))
22 .then(t.step_func(function(frame) { 19 .then(t.step_func(function(frame) {
23 var w = frame.contentWindow; 20 var w = frame.contentWindow;
24 var controller = w.navigator.serviceWorker.controller; 21 var controller = w.navigator.serviceWorker.controller;
25 assert_true(controller instanceof w.ServiceWorker, 22 assert_true(controller instanceof w.ServiceWorker,
26 'controller should be a ServiceWorker object'); 23 'controller should be a ServiceWorker object');
27 assert_equals(controller.scriptURL, normalizeURL(url)); 24 assert_equals(controller.scriptURL, normalizeURL(url));
28 service_worker_unregister_and_done(t, scope); 25 service_worker_unregister_and_done(t, scope);
29 })) 26 }))
30 .catch(unreached_rejection(t)); 27 .catch(unreached_rejection(t));
31 }); 28 });
32 </script> 29 </script>
33 </body> 30 </body>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/client-focus.html ('k') | LayoutTests/http/tests/serviceworker/controller-on-reload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698