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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/stop-worker-during-respond-with.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/stop-worker-during-respond-with.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/stop-worker-during-respond-with.html
new file mode 100644
index 0000000000000000000000000000000000000000..25af25532aa4c58c296ba1fe46905b01d04d8b0d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/stop-worker-during-respond-with.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>Service Worker: Stopping the worker during responding to a fetch</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/test-helpers.js"></script>
+<script>
+
+promise_test(t => {
+ 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.
+ var SCRIPT = 'resources/respondwith-fetch-worker.js';
+ var IFRAME_URL = 'resources/slow-fetch-and-stop-worker-iframe.html';
+ return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
+ .then(r => {
+ add_completion_callback(() => r.unregister());
+ return wait_for_state(t, r.installing, 'activated');
+ })
+ .then(() => { return with_iframe(IFRAME_URL, {auto_remove: true}); })
+ .then(f => {
+ return new Promise(resolve => {
+ addEventListener('message', resolve);
+ f.contentWindow.postMessage('run', '*');
+ })
+ })
+ .then(e => {
+ assert_equals(e.data, 'Rejected successfully');
+ });
+ }, 'Stopping the worker during responding fetch event cancels the request.');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698