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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/resources/click-event-test.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 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('/resources/testharness.js'); 2 importScripts('/resources/testharness.js');
3 importScripts('worker-helpers.js'); 3 importScripts('worker-helpers.js');
4 } 4 }
5 5
6 async_test(function(test) { 6 async_test(function(test) {
7 if (Notification.permission != 'granted') { 7 if (Notification.permission != 'granted') {
8 assert_unreached('No permission has been granted for displaying notifica tions.'); 8 assert_unreached('No permission has been granted for displaying notifica tions.');
9 return; 9 return;
10 } 10 }
11 11
12 var notification = new Notification('My Notification'); 12 var notification = new Notification('My Notification');
13 notification.addEventListener('show', function() { 13 notification.addEventListener('show', function() {
14 if (testRunner) 14 if (testRunner)
15 testRunner.simulateWebNotificationClick('My Notification'); 15 testRunner.simulateWebNotificationClick('My Notification', -1 /* act ion_index */);
16 }); 16 });
17 17
18 notification.addEventListener('click', function() { 18 notification.addEventListener('click', function() {
19 test.done(); 19 test.done();
20 }); 20 });
21 21
22 notification.addEventListener('error', function() { 22 notification.addEventListener('error', function() {
23 assert_unreached('The error event should not be thrown.'); 23 assert_unreached('The error event should not be thrown.');
24 }); 24 });
25 25
26 }, 'Simulating a click on the notification should fire the onclick() event.'); 26 }, 'Simulating a click on the notification should fire the onclick() event.');
27 27
28 if (isDedicatedOrSharedWorker()) 28 if (isDedicatedOrSharedWorker())
29 done(); 29 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698