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

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

Issue 1974033003: Ship the Notification.action and Notification.vibration properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe-statics
Patch Set: Ship the Notification.action and Notification.vibration properties Created 4 years, 5 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 a nd SWR.getNotifications().</title> 4 <title>Notifications: Property reflection in the "notificationclick" event a nd SWR.getNotifications().</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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // (3) Confirm that all properties set on the cloned Notification object are as expected. 89 // (3) Confirm that all properties set on the cloned Notification object are as expected.
90 assert_object_is_superset(data.notification, options, 'The Notific ation object properties must be the same in notificationclick events.'); 90 assert_object_is_superset(data.notification, options, 'The Notific ation object properties must be the same in notificationclick events.');
91 return registration.getNotifications(); 91 return registration.getNotifications();
92 }).then(function(notifications) { 92 }).then(function(notifications) {
93 // (4) Check that the properties are also set correctly on the non -cloned Notification 93 // (4) Check that the properties are also set correctly on the non -cloned Notification
94 // object from getNotifications. 94 // object from getNotifications.
95 assert_equals(notifications.length, 1); 95 assert_equals(notifications.length, 1);
96 assert_object_is_superset(notifications[0], options, 'The Notifica tion object properties must be the same in getNotifications.'); 96 assert_object_is_superset(notifications[0], options, 'The Notifica tion object properties must be the same in getNotifications.');
97 97
98 notifications[0].actions.foo = 'bar'; 98 notifications[0].actions.foo = 'bar';
99 notifications[0].actions.push({ title: 'Foo' }); 99 assert_throws(null, () => notifications[0].actions.push({ title: ' Foo' }));
100
100 if (notifications[0].actions.length) { 101 if (notifications[0].actions.length) {
101 notifications[0].actions[0].title = 'Changed'; 102 notifications[0].actions[0].title = 'Changed';
102 notifications[0].actions[0].foo = 'bar'; 103 notifications[0].actions[0].foo = 'bar';
103 } 104 }
105
104 assert_object_equals(notifications[0].actions, options.actions, 'T he actions field should be immutable.'); 106 assert_object_equals(notifications[0].actions, options.actions, 'T he actions field should be immutable.');
105 107
106 // TODO(johnme): This should pass before shipping Notification.act ions; this is blocked on https://crbug.com/515920. 108 assert_equals(notifications[0].actions, notifications[0].actions, '`actions` attribute equality');
107 //assert_equals(notifications[0].actions, notifications[0].actions , 'The actions field should === itself.'); 109 assert_equals(notifications[0].data, notifications[0].data, '`data ` attribute equality');
110 assert_equals(notifications[0].vibrate, notifications[0].vibrate, '`vibrate` attribute equality');
108 111
109 test.done(); 112 test.done();
110 }).catch(unreached_rejection(test)); 113 }).catch(unreached_rejection(test));
111 114
112 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.'); 115 }, 'Clicking on a notification displayed by a Service Worker the notificat ionclick event.');
113 </script> 116 </script>
114 </body> 117 </body>
115 </html> 118 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698