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

Side by Side Diff: LayoutTests/fast/notifications/resources/worker-tools.js

Issue 624033003: [WIP] Move Web Notifications to a WebFrame-less code path (Blink). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: current state Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 function startWorkerTest(script, type)
2 {
3 var worker, messagePort;
4
5 switch (type) {
6 case 'dedicated':
7 worker = startWorker(script, false);
8 messagePort = worker;
9 break;
10 case 'shared':
11 worker = startWorker(script, true);
12 messagePort = worker.port;
13 break;
14 case 'service':
15 testFailed('Service Worker-based tests have not been implemented yet.');
16 return;
17 }
18
19 messagePort.addEventListener('message', function(event) {
20 if (event.data.length < 5 || event.data.charAt(4) == ':')
21 return; // this is a js-test.js message.
22
23 if (!window.testRunner)
24 return; // the test-runner is needed to provide automation.
25
26 var chunks = event.data.split('::');
27 switch (chunks[0]) {
28 case 'simulateClick':
29 testRunner.simulateWebNotificationClick(chunks[1]);
30 break;
31 }
32 });
33 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/notifications/resources/notification-worker.js ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698