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

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: Rebase 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0a23769a106b6a2bee5bed36f32b399a1f0151ac..04c94a7d510f920b996c995fd3a1333c4f0e77a1 100644
--- a/LayoutTests/http/tests/notifications/notification-properties.html
+++ b/LayoutTests/http/tests/notifications/notification-properties.html
@@ -26,6 +26,7 @@
// Deliberately add more actions than are supported.
for (var i = 0; i < 2 * Notification.maxActions; i++) {
options.actions.push({
+ action: "" + i,
Peter Beverloo 2015/07/31 18:05:34 No need for "" (bindings should do that for you)
johnme 2015/07/31 18:14:22 Done.
title: "Action " + i
});
}
@@ -123,18 +124,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.
Peter Beverloo 2015/07/31 18:05:34 Please use a full sentence.
johnme 2015/07/31 18:14:22 Done.
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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/serviceworker-notificationclick-event-reflection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698