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

Side by Side Diff: LayoutTests/http/tests/serviceworker/extendable-event-waituntil.html

Issue 773153002: ServiceWorker: remove get_newest_worker() helper (cleanup) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove get_newest_worker() 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/postmessage.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>ExtendableEvent: waitUntil</title> 2 <title>ExtendableEvent: waitUntil</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 <script> 6 <script>
7 // Temporary measure to diagnose timeouts on Win XP. Let the W3C harness 7 // Temporary measure to diagnose timeouts on Win XP. Let the W3C harness
8 // timeout before run-webkit-tests does, so it can report the particular 8 // timeout before run-webkit-tests does, so it can report the particular
9 // test that timed out. 9 // test that timed out.
10 // FIXME: Remove after the cause of timeout is fixed. 10 // FIXME: Remove after the cause of timeout is fixed.
11 var properties = {timeout: 5500}; 11 var properties = {timeout: 5500};
12 12
13 function runTest(test, scope, onRegister) { 13 function runTest(test, scope, onRegister) {
14 var script = 'resources/extendable-event-waituntil.js'; 14 var script = 'resources/extendable-event-waituntil.js';
15 service_worker_unregister_and_register(test, script, scope) 15 service_worker_unregister_and_register(test, script, scope)
16 .then(function(registration) { 16 .then(function(registration) {
17 return get_newest_worker(registration); 17 onRegister(registration.installing);
18 }) 18 });
19 .then(test.step_func(onRegister));
20 } 19 }
21 20
22 function syncWorker(test, worker, obj) { 21 function syncWorker(test, worker, obj) {
23 var channel = new MessageChannel(); 22 var channel = new MessageChannel();
24 channel.port1.onmessage = test.step_func(function(e) { 23 channel.port1.onmessage = test.step_func(function(e) {
25 var message = e.data; 24 var message = e.data;
26 assert_equals(message, 'SYNC', 25 assert_equals(message, 'SYNC',
27 'Should receive sync message from worker.'); 26 'Should receive sync message from worker.');
28 obj.synced = true; 27 obj.synced = true;
29 channel.port1.postMessage('ACK'); 28 channel.port1.postMessage('ACK');
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 var onRegister = function(worker) { 122 var onRegister = function(worker) {
124 wait_for_state(t, worker, 'redundant') 123 wait_for_state(t, worker, 'redundant')
125 .then(function() { 124 .then(function() {
126 service_worker_unregister_and_done(t, scope); 125 service_worker_unregister_and_done(t, scope);
127 }) 126 })
128 .catch(unreached_rejection(t)); 127 .catch(unreached_rejection(t));
129 }; 128 };
130 runTest(t, scope, onRegister); 129 runTest(t, scope, onRegister);
131 }, 'Test ExtendableEvent waitUntil reject precedence.', properties); 130 }, 'Test ExtendableEvent waitUntil reject precedence.', properties);
132 </script> 131 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/postmessage.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698