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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/stop-worker-during-respond-with.html

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Rebased Created 3 years, 8 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
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: Stopping the worker during responding to a fetch</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../resources/test-helpers.js"></script>
6 <script>
7
8 promise_test(t => {
9 var SCOPE = 'resources/';
horo 2017/04/12 06:21:58 nit: I prefer narrow scope to avoid interactions b
shimazu 2017/04/18 01:50:04 Done.
10 var SCRIPT = 'resources/respondwith-fetch-worker.js';
11 var IFRAME_URL = 'resources/slow-fetch-and-stop-worker-iframe.html';
12 return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
13 .then(r => {
14 add_completion_callback(() => r.unregister());
15 return wait_for_state(t, r.installing, 'activated');
16 })
17 .then(() => { return with_iframe(IFRAME_URL, {auto_remove: true}); })
18 .then(f => {
19 return new Promise(resolve => {
20 addEventListener('message', resolve);
21 f.contentWindow.postMessage('run', '*');
22 })
23 })
24 .then(e => {
25 assert_equals(e.data, 'Rejected successfully');
26 });
27 }, 'Stopping the worker during responding fetch event cancels the request.');
28
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698