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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: postMessage Blob URL</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script>
6 <script>
7 promise_test(t => {
8 let script = 'resources/postmessage-blob-url.js';
9 let scope = 'resources/blank.html';
10 let registration;
11 let blobText = 'Blob text';
12 let blob;
13 let blobUrl;
14
15 return service_worker_unregister_and_register(t, script, scope)
16 .then(r => {
17 add_completion_callback(() => r.unregister());
18 registration = r;
19 let worker = registration.installing;
20 blob = new Blob([blobText]);
21 blobUrl = URL.createObjectURL(blob);
22 return new Promise(resolve => {
23 navigator.serviceWorker.onmessage = e => { resolve(e.data); }
24 worker.postMessage(blobUrl);
25 });
26 })
27 .then(response => {
28 assert_equals(response, 'Worker reply:' + blobText);
29 URL.revokeObjectURL(blobUrl);
30 return registration.unregister();
31 });
32 }, 'postMessage Blob URL to a ServiceWorker');
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698