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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-worker.js

Issue 2875383002: Upstream service worker `postMessage` tests to WPT (Closed)
Patch Set: Incorporate review feedback Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-worker.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var port;
2
3 // Exercise the 'onmessage' handler:
4 self.onmessage = function(e) {
5 var message = e.data;
6 if ('port' in message) {
7 port = message.port;
8 }
9 };
10
11 // And an event listener:
12 self.addEventListener('message', function(e) {
13 var message = e.data;
14 if ('value' in message) {
15 port.postMessage('Acking value: ' + message.value);
16 } else if ('done' in message) {
17 port.postMessage('quit');
18 }
19 });
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/postmessage-transferables-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698