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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-body-mixin.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: Body mixin</title> 2 <title>Service Worker: Body mixin</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 async_test(function(t) { 7 async_test(function(t) {
8 var scope = 'resources/blank.html'; 8 var scope = 'resources/blank.html';
9 service_worker_unregister_and_register( 9 service_worker_unregister_and_register(
10 t, 'resources/fetch-body-mixin-worker.js', scope) 10 t, 'resources/fetch-body-mixin-worker.js', scope)
11 .then(function(registration) { 11 .then(function(registration) {
12 return wait_for_update(t, registration); 12 var sw = registration.installing;
13 })
14 .then(function(sw) {
15 var messageChannel = new MessageChannel(); 13 var messageChannel = new MessageChannel();
16 messageChannel.port1.onmessage = t.step_func(onMessage); 14 messageChannel.port1.onmessage = t.step_func(onMessage);
17 sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]); 15 sw.postMessage({port: messageChannel.port2}, [messageChannel.port2]);
18 }) 16 })
19 .catch(unreached_rejection(t)); 17 .catch(unreached_rejection(t));
20 18
21 var result = []; 19 var result = [];
22 var expected = [ 20 var expected = [
23 'Text: <!DOCTYPE html>\n', 21 'Text: <!DOCTYPE html>\n',
24 'JSON: 1 2', 22 'JSON: 1 2',
(...skipping 11 matching lines...) Expand all
36 if (message == 'quit') { 34 if (message == 'quit') {
37 assert_array_equals(result, expected, 35 assert_array_equals(result, expected,
38 'Worker should post back expected values.'); 36 'Worker should post back expected values.');
39 service_worker_unregister_and_done(t, scope); 37 service_worker_unregister_and_done(t, scope);
40 } else { 38 } else {
41 result.push(message); 39 result.push(message);
42 } 40 }
43 } 41 }
44 }, 'Verify FetchBodyStream in a Service Worker'); 42 }, 'Verify FetchBodyStream in a Service Worker');
45 </script> 43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698