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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-event-respond-with-stops-propagation.html

Issue 731433002: Service Worker: respondWith() invokes stopImmediatePropagation() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fmt Created 6 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-stops-propagation-worker.js » ('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 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script> 3 <script src="../resources/testharness-helpers.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 promise_test(function(t) { 7 promise_test(function(t) {
8 var script = 'resources/fetch-event-async-respond-with-worker.js'; 8 var script =
9 'resources/fetch-event-respond-with-stops-propagation-worker.js';
9 var scope = 'resources/simple.html'; 10 var scope = 'resources/simple.html';
10 11
11 return service_worker_unregister_and_register(t, script, scope) 12 return service_worker_unregister_and_register(t, script, scope)
12 .then(function(registration) { 13 .then(function(registration) {
13 return wait_for_activated(t, registration); 14 return wait_for_activated(t, registration);
14 }) 15 })
15 .then(function() { 16 .then(function() {
16 return with_iframe(scope); 17 return with_iframe(scope);
17 }) 18 })
18 .then(function(frame) { 19 .then(function(frame) {
19 var channel = new MessageChannel(); 20 var channel = new MessageChannel();
20 var saw_message = new Promise(function(resolve) { 21 var saw_message = new Promise(function(resolve) {
21 channel.port1.onmessage = function(e) { resolve(e.data); } 22 channel.port1.onmessage = function(e) { resolve(e.data); }
22 }); 23 });
23 var worker = frame.contentWindow.navigator.serviceWorker.controller; 24 var worker = frame.contentWindow.navigator.serviceWorker.controller;
24 25
25 frame.remove(); 26 frame.remove();
26 worker.postMessage({port: channel.port2}, [channel.port2]); 27 worker.postMessage({port: channel.port2}, [channel.port2]);
27 return saw_message; 28 return saw_message;
28 }) 29 })
29 .then(function(message) { 30 .then(function(message) {
30 assert_equals(message, 'PASS'); 31 assert_equals(message, 'PASS');
31 return service_worker_unregister_and_done(t, scope); 32 return service_worker_unregister_and_done(t, scope);
32 }) 33 })
33 }, 'Calling respondWith asynchronously throws an exception'); 34 }, 'respondWith() invokes stopImmediatePropagation()');
34 </script> 35 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-event-respond-with-stops-propagation-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698