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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-event.html

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 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: NotificationEvent exposure in a Service Worker.</title > 4 <title>Notifications: NotificationEvent exposure in a Service Worker.</title >
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script> 7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 <script src="resources/test-helpers.js"></script> 8 <script src="resources/test-helpers.js"></script>
9 </head> 9 </head>
10 <body> 10 <body>
(...skipping 15 matching lines...) Expand all
26 workerInfo = info; 26 workerInfo = info;
27 27
28 // (1) Display a Web Notification from the document. 28 // (1) Display a Web Notification from the document.
29 assert_inherits(workerInfo.registration, 'showNotification', 'show Notification() must be exposed.'); 29 assert_inherits(workerInfo.registration, 'showNotification', 'show Notification() must be exposed.');
30 return workerInfo.registration.showNotification(scope, { 30 return workerInfo.registration.showNotification(scope, {
31 body: 'Hello, world!', 31 body: 'Hello, world!',
32 icon: '/icon.png' 32 icon: '/icon.png'
33 }); 33 });
34 }).then(function() { 34 }).then(function() {
35 // (2) Simulate a click on the notification that has been displaye d. 35 // (2) Simulate a click on the notification that has been displaye d.
36 testRunner.simulateWebNotificationClick(scope); 36 testRunner.simulateWebNotificationClick(scope, -1 /* action_index */);
37 37
38 workerInfo.port.addEventListener('message', function(event) { 38 workerInfo.port.addEventListener('message', function(event) {
39 if (typeof event.data != 'boolean') { 39 if (typeof event.data != 'boolean') {
40 assert_unreached('Received an invalid message from the Ser vice Worker.'); 40 assert_unreached('Received an invalid message from the Ser vice Worker.');
41 return; 41 return;
42 } 42 }
43 43
44 // (3) Verify that the tests were successful in the Service Wo rker. 44 // (3) Verify that the tests were successful in the Service Wo rker.
45 assert_true(event.data); 45 assert_true(event.data);
46 46
47 test.done(); 47 test.done();
48 }); 48 });
49 }).catch(unreached_rejection(test)); 49 }).catch(unreached_rejection(test));
50 50
51 }, 'The NotificationEvent exposes the expected semantics in a Service Work er.'); 51 }, 'The NotificationEvent exposes the expected semantics in a Service Work er.');
52 </script> 52 </script>
53 </body> 53 </body>
54 </html> 54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698