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

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

Issue 1263043003: Add NotificationAction.action member (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/notifications/notification-properties.html
diff --git a/LayoutTests/http/tests/notifications/notification-properties.html b/LayoutTests/http/tests/notifications/notification-properties.html
index f57edca70c52dcd8439b8a31b1230db63f81955b..2ae84cf9b3474f8f5205b0db2bd3542afcdd56c9 100644
--- a/LayoutTests/http/tests/notifications/notification-properties.html
+++ b/LayoutTests/http/tests/notifications/notification-properties.html
@@ -19,7 +19,9 @@
icon: "http://localhost/my_icon.png",
silent: true,
data: "my data",
- actions: [{title: "Action 1"}, {title: "Action 2"}, {title: "Action 3"}]
+ actions: [{action: "one", title: "Action 1"},
+ {action: "two", title: "Action 2"},
+ {action: "three", title: "Action 3"}]
};
var notification = new Notification("My Notification", options);
@@ -106,18 +108,28 @@
});
}, 'Set vibrate, when silent is true.');
- // Check exception is thrown when an action doesn't contain title,
- // or title is an empty string.
+ // Check exception is thrown when an action doesn't contain
+ // action/title, or when action/title is an empty string.
assert_throws(new TypeError(), function() {
var notification = new Notification("My Notification", {
- actions: [{}]
+ actions: [{title: "Foo"}]
});
- }, 'Provide action without title.');
+ }, 'NotificationAction without action.');
assert_throws(new TypeError(), function() {
var notification = new Notification("My Notification", {
- actions: [{title: ""}]
+ actions: [{action: "foo"}]
});
- }, 'Provide action with empty title.');
+ }, 'NotificationAction without title.');
+ assert_throws(new TypeError(), function() {
+ var notification = new Notification("My Notification", {
+ actions: [{action: "", title: "Foo"}]
+ });
+ }, 'NotificationAction with empty action.');
+ assert_throws(new TypeError(), function() {
+ var notification = new Notification("My Notification", {
+ actions: [{action: "foo", title: ""}]
+ });
+ }, 'NotificationAction with empty title.');
}, 'Checks the properties exposed on the Notification object.');
</script>

Powered by Google App Engine
This is Rietveld 408576698