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

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

Issue 1409143004: Only allow action buttons in persistent notifications per spec update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sw-not-props
Patch Set: Address review nits Created 5 years, 2 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
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..a9afb21368b1fda34763dfba1247b6e3389aab78 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: "a" + i,
+ 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) {
+ 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; this is blocked on https://crbug.com/515920.
+ //assert_equals(notifications[0].actions, notifications[0].actions, 'The actions field should === itself.');
+
test.done();
});
});

Powered by Google App Engine
This is Rietveld 408576698