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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage-blob-url.https.html

Issue 2695093003: Add LayoutTests to test Blob URL transfer to {Shared,Service}Workers (Closed)
Patch Set: . Created 3 years, 10 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/external/wpt/service-workers/service-worker/postmessage-blob-url.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage-blob-url.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage-blob-url.https.html
new file mode 100644
index 0000000000000000000000000000000000000000..16fddd57b835240112b1a0b2b2c03835e7695e1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage-blob-url.https.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Service Worker: postMessage Blob URL</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<script>
+promise_test(t => {
+ let script = 'resources/postmessage-blob-url.js';
+ let scope = 'resources/blank.html';
+ let registration;
+ let blobText = 'Blob text';
+ let blob;
+ let blobUrl;
+
+ return service_worker_unregister_and_register(t, script, scope)
+ .then(r => {
+ add_completion_callback(() => r.unregister());
+ registration = r;
+ let worker = registration.installing;
+ blob = new Blob([blobText]);
+ blobUrl = URL.createObjectURL(blob);
+ return new Promise(resolve => {
+ navigator.serviceWorker.onmessage = e => { resolve(e.data); }
+ worker.postMessage(blobUrl);
+ });
+ })
+ .then(response => {
+ assert_equals(response, 'Worker reply:' + blobText);
+ URL.revokeObjectURL(blobUrl);
+ return registration.unregister();
+ });
+ }, 'postMessage Blob URL to a ServiceWorker');
+</script>

Powered by Google App Engine
This is Rietveld 408576698