Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html |
| index 4e35e701cbaab59f10b4e1f20e0b4548c6350749..af430f63cbe4c0320b8539ba02f74eae9ae01180 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html |
| @@ -46,10 +46,15 @@ |
| scalar: true }, |
| 12.15 |
| ], |
| - actions: [{ action: 'one', title: 'Action 1' }, |
| - { action: 'two', title: 'Action 2' }, |
| - { action: 'three', title: 'Action 3' }] |
| + actions: [] |
| }; |
| + // Deliberately add more actions than are supported. |
| + for (var i = 0; i < 2 * Notification.maxActions; i++) { |
| + options.actions.push({ |
| + action: "" + i, |
|
Peter Beverloo
2015/10/21 17:02:52
nit: no need for the "" (ES ToString() will be app
johnme
2015/10/21 18:11:31
I prefer to be explicit though. Changed it to `"a"
|
| + title: "Action " + i |
| + }); |
| + } |
| testRunner.setPermission('notifications', 'granted', location.origin, location.origin); |
| getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) { |
| @@ -89,6 +94,18 @@ |
| workerInfo.registration.getNotifications().then(function(notifications) { |
| assert_equals(notifications.length, 1); |
| assert_object_is_superset(notifications[0], options, 'The Notification object properties must be the same in getNotifications.'); |
| + |
| + notifications[0].actions.foo = "bar"; |
| + notifications[0].actions.push({ title: "Foo" }); |
| + if (notifications[0].actions.length) { |
|
Peter Beverloo
2015/10/21 17:02:52
When would this be true?
johnme
2015/10/21 18:11:31
It'll be true whenever Notification.maxActions > 0
|
| + notifications[0].actions[0].title = "Changed"; |
| + notifications[0].actions[0].foo = "bar"; |
| + } |
| + assert_object_equals(notifications[0].actions, options.actions, 'The actions field should be immutable.'); |
| + |
| + // TODO(johnme): This should pass before shipping Notification.actions. |
|
Peter Beverloo
2015/10/21 17:02:52
+bug
johnme
2015/10/21 18:11:31
Done.
|
| + //assert_equals(notifications[0].actions, notifications[0].actions, 'The actions field should === itself.'); |
| + |
| test.done(); |
| }); |
| }); |