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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/notifications/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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..448f5622fe9895053e3e42644821dd6fd60afb81 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(emptyNotification.vibrate, []);
assert_false(emptyNotification.silent);
assert_false(emptyNotification.requireInteraction);
assert_equals(emptyNotification.data, null);
@@ -69,10 +75,8 @@
});
// 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');
+ assert_equals(equalNotification.data, equalNotification.data, '`data` object equality');
+ assert_equals(equalNotification.vibrate, equalNotification.vibrate, '`vibrate` object equality');
var serializedUrlNotification = new Notification("My Notification", {
icon: "https://example.com/icon.png",
@@ -96,6 +100,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", {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698