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

Side by Side Diff: LayoutTests/http/tests/serviceworker/ready.html

Issue 466723002: ServiceWorker: Enable ServiceWorkerRegistration and update layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@updatefound
Patch Set: rebase Created 6 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: navigator.serviceWorker.ready</title> 2 <title>Service Worker: navigator.serviceWorker.ready</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 test(function() { 8 test(function() {
9 var promise = navigator.serviceWorker.ready; 9 var promise = navigator.serviceWorker.ready;
10 assert_equals(promise, navigator.serviceWorker.ready, 10 assert_equals(promise, navigator.serviceWorker.ready,
(...skipping 14 matching lines...) Expand all
25 })); 25 }));
26 }, 'ready returns a Promise object in the context of the related document'); 26 }, 'ready returns a Promise object in the context of the related document');
27 27
28 async_test(function(t) { 28 async_test(function(t) {
29 var url = 'resources/worker-no-op.js'; 29 var url = 'resources/worker-no-op.js';
30 var scope = 'resources/blank.html?ready-active'; 30 var scope = 'resources/blank.html?ready-active';
31 var frame; 31 var frame;
32 var registered_service_worker; 32 var registered_service_worker;
33 33
34 service_worker_unregister_and_register(t, url, scope) 34 service_worker_unregister_and_register(t, url, scope)
35 .then(t.step_func(function(registration) {
36 return wait_for_update(t, registration);
37 }))
35 .then(t.step_func(function(service_worker) { 38 .then(t.step_func(function(service_worker) {
36 registered_service_worker = service_worker; 39 registered_service_worker = service_worker;
37 return wait_for_state(t, service_worker, 'activating'); 40 return wait_for_state(t, service_worker, 'activating');
38 })) 41 }))
39 .then(t.step_func(function() { 42 .then(t.step_func(function() {
40 return with_iframe(scope); 43 return with_iframe(scope);
41 })) 44 }))
42 .then(t.step_func(function(f) { 45 .then(t.step_func(function(f) {
43 frame = f; 46 frame = f;
44 return frame.contentWindow.navigator.serviceWorker.ready; 47 return frame.contentWindow.navigator.serviceWorker.ready;
(...skipping 17 matching lines...) Expand all
62 'ServiceWorker than register because of ' + 65 'ServiceWorker than register because of ' +
63 'different prototypes'); 66 'different prototypes');
64 frame.remove(); 67 frame.remove();
65 service_worker_unregister_and_done(t, scope); 68 service_worker_unregister_and_done(t, scope);
66 })); 69 }));
67 }, 'ready resolves to active'); 70 }, 'ready resolves to active');
68 71
69 // FIXME: When replace() is implemented add a test that .ready is 72 // FIXME: When replace() is implemented add a test that .ready is
70 // repeatedly created and settled. 73 // repeatedly created and settled.
71 </script> 74 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698