 Chromium Code Reviews
 Chromium Code Reviews Issue 1974033003:
  Ship the Notification.action and Notification.vibration properties  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe-statics
    
  
    Issue 1974033003:
  Ship the Notification.action and Notification.vibration properties  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe-statics| Index: third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html | 
| diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html b/third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html | 
| index 2550ab27fdf25fca3ba0fa90ae19ef6cd5a94c3b..e25a003d7b5076c90a0aec30c9a9a2551d7c7d59 100644 | 
| --- a/third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html | 
| +++ b/third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html | 
| @@ -45,6 +45,12 @@ | 
| assert_equals(notification.data, options.data); | 
| assert_array_equals(notification.actions, options.actions); | 
| + // The `actions` field should be immutable. | 
| + assert_throws(null, () => notification.actions.push(null)); | 
| + | 
| + notification.actions.foo = 'bar'; | 
| + assert_false(notification.actions.hasOwnProperty('foo')); | 
| + | 
| var emptyNotification = new Notification("My Notification"); | 
| assert_equals(emptyNotification.title, "My Notification"); | 
| @@ -54,7 +60,7 @@ | 
| assert_equals(emptyNotification.tag, ""); | 
| assert_equals(emptyNotification.icon, ""); | 
| assert_equals(emptyNotification.badge, ""); | 
| - assert_equals(notification.vibrate, null); | 
| + assert_array_equals(notification.vibrate, []); | 
| 
Michael van Ouwerkerk
2016/05/12 15:04:59
nit: use emptyNotification here
 
Peter Beverloo
2016/05/12 15:10:13
Done.
 | 
| assert_false(emptyNotification.silent); | 
| assert_false(emptyNotification.requireInteraction); | 
| assert_equals(emptyNotification.data, null); | 
| @@ -71,9 +77,6 @@ | 
| // Test equality of the object attributes. | 
| assert_true(equalNotification.data === equalNotification.data, '`data` object equality'); | 
| - // TODO(peter): This should pass before shipping Notification.vibrate. | 
| - //assert_true(equalNotification.vibrate === equalNotification.vibrate, '`vibrate` object equality'); | 
| - | 
| var serializedUrlNotification = new Notification("My Notification", { | 
| icon: "https://example.com/icon.png", | 
| badge: "https://example.com/badge.png" | 
| @@ -96,6 +99,12 @@ | 
| // vibrate pattern should be returned in serialized form. | 
| assert_array_equals(vibrateNotification.vibrate, [1000]); | 
| + // The `vibrate` property should be immutable. | 
| + assert_throws(null, () => vibrateNotification.vibrate.push(1000)); | 
| + | 
| + vibrateNotification.vibrate[0] = 2000; | 
| + assert_equals(vibrateNotification.vibrate[0], 1000); | 
| + | 
| // Tests that it must be a valid vibration sequence. | 
| var pattern = new Array(100, 200, 300); | 
| var sequenceVibrateNotification = new Notification("My Notification", { |