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

Side by Side Diff: LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html

Issue 1262893005: Add NotificationEvent.action property in SW events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions3_fix
Patch Set: Created 5 years, 4 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: Property reflection in the "notificationclick" event.< /title> 4 <title>Notifications: Property reflection in the "notificationclick" event.< /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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 testRunner.simulateWebNotificationClick(scope); 62 testRunner.simulateWebNotificationClick(scope);
63 return; 63 return;
64 } 64 }
65 65
66 // (3) Listen for confirmation from the Service Worker that th e 66 // (3) Listen for confirmation from the Service Worker that th e
67 // notification has been clicked on. Make sure that all proper ties 67 // notification has been clicked on. Make sure that all proper ties
68 // set on the Notification object are as expected. 68 // set on the Notification object are as expected.
69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.'); 69 assert_equals(event.data.command, 'click', 'The notification w as expected to be clicked.');
70 70
71 Object.keys(options).forEach(function(key) { 71 Object.keys(options).forEach(function(key) {
72 if (key == 'actions') { 72 if (key == "actions")
Peter Beverloo 2015/08/04 21:01:23 Single quotes. (Consistency with the file.)
johnme 2015/08/05 11:56:22 Done.
73 // TODO(johnme): actions are not yet serialized proper ly. 73 assert_object_equals(event.data.notification.actions, options.actions.slice(0, Notification.maxActions));
74 return; 74 else
75 } 75 assert_object_equals(event.data.notification[key], opt ions[key], 'The ' + key + ' field must be the same.');
76 assert_object_equals(event.data.notification[key], options [key], 'The ' + key + ' field must be the same.');
77 }); 76 });
78 77
79 test.done(); 78 test.done();
80 }); 79 });
81 }).catch(unreached_rejection(test)); 80 }).catch(unreached_rejection(test));
82 81
83 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); 82 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.');
84 </script> 83 </script>
85 </body> 84 </body>
86 </html> 85 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698