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

Side by Side Diff: LayoutTests/http/tests/notifications/service-worker-show-notification-click.html

Issue 789643003: The Service Worker notificationclick event should carry a notification. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add missing file Created 6 years 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
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: ServiceWorkerRegistration.showNotification().</title> 4 <title>Notifications: ServiceWorkerRegistration.showNotification().</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 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 29 matching lines...) Expand all
40 }); 40 });
41 }).then(function () { 41 }).then(function () {
42 assert_inherits(registration, 'showNotification', 'showNotificatio n() must be exposed.'); 42 assert_inherits(registration, 'showNotification', 'showNotificatio n() must be exposed.');
43 43
44 return registration.showNotification(scope, { 44 return registration.showNotification(scope, {
45 body: 'Hello, world!', 45 body: 'Hello, world!',
46 icon: '/icon.png' 46 icon: '/icon.png'
47 }); 47 });
48 }).then(function () { 48 }).then(function () {
49 messagePort.addEventListener('message', function(event) { 49 messagePort.addEventListener('message', function(event) {
50 assert_equals(event.data, 'The notification has been clicked o n.'); 50 assert_equals(event.data, 'Clicked on Notification: ' + scope) ;
51 test.done(); 51 test.done();
52 }); 52 });
53 53
54 testRunner.simulateWebNotificationClick(scope); 54 testRunner.simulateWebNotificationClick(scope);
55 55
56 }).catch(unreached_rejection(test)); 56 }).catch(unreached_rejection(test));
57 57
58 }, 'Clicking on a notification displayed through showNotification() fires a Service Worker event.'); 58 }, 'Clicking on a notification displayed through showNotification() fires a Service Worker event.');
59 </script> 59 </script>
60 </body> 60 </body>
61 </html> 61 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698