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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/request-body-blob.html

Issue 1967683003: service worker: Wait for request body blobs to finish construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 7 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/request-body-blob.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/request-body-blob.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/request-body-blob.html
new file mode 100644
index 0000000000000000000000000000000000000000..edcb8f602d9b6df89320b59eb29940d224ccec27
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/request-body-blob.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>request body</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.js"></script>
+<script>
+var resolve_done;
+var done_was_called = new Promise(resolve => resolve_done = resolve);
+// Called by the iframe when done.
+function done(result) { resolve_done(result); }
+
+// This test creates an controlled iframe that does a request with a request
+// body blob. The service worker confirms it can read the blob and responds
+// with 'Pass'.
+promise_test(t => {
+ var worker = 'resources/request-body-blob-worker.js';
+ var scope = 'resources/request-body-blob-iframe.html';
+ var registration;
+ return service_worker_unregister_and_register(t, worker, scope)
+ .then(reg => {
+ registration = reg;
+ wait_for_state(t, reg.installing, 'activated');
+ })
+ .then(() => with_iframe(scope))
+ .then(() => done_was_called)
+ .then(result => {
+ assert_equals(result, 'Pass');
+ registration.unregister();
+ });
+ }, 'Service worker can read the request body blob');
+</script>

Powered by Google App Engine
This is Rietveld 408576698