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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/resources/worker-helpers.js

Issue 1644063002: Simplify TestRunnerBindings::SimulateWebNotificationClick param handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
1 var _port = self; 1 var _port = self;
2 2
3 // Returns whether the test is being ran in a dedicated or a shared worker. The 3 // Returns whether the test is being ran in a dedicated or a shared worker. The
4 // testharness.js framework requires done() to be called when this is the case. 4 // testharness.js framework requires done() to be called when this is the case.
5 function isDedicatedOrSharedWorker() 5 function isDedicatedOrSharedWorker()
6 { 6 {
7 return self.importScripts && !self.scope; 7 return self.importScripts && !self.scope;
8 } 8 }
9 9
10 // Shared Workers will receive their message port once the first page connects t o it. 10 // Shared Workers will receive their message port once the first page connects t o it.
11 self.addEventListener('connect', function(event) { 11 self.addEventListener('connect', function(event) {
12 _port = event.ports[0]; 12 _port = event.ports[0];
13 }); 13 });
14 14
15 var testRunner = { 15 var testRunner = {
16 simulateWebNotificationClick: function(title) 16 simulateWebNotificationClick: function(title, action_index)
17 { 17 {
18 if (_port) 18 if (_port)
19 _port.postMessage({ type: 'simulateWebNotificationClick', title: tit le }); 19 _port.postMessage({ type: 'simulateWebNotificationClick', title: tit le, action_index: action_index });
20 } 20 }
21 }; 21 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698