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

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: Fix rebase Created 5 years, 4 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..7e02473d68739bdca4ba3da1a38184e35ac3a928 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,
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 a NotificationAction is missing
+ // action or title, or when action or 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>
« 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