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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/notifications/notification-properties.html

Issue 1855443002: Implement receiving side of web notification inline replies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test and removed unnecessary code. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Notifications: The Notification object exposes the expected propertie s.</title> 4 <title>Notifications: The Notification object exposes the expected propertie s.</title>
5 <script src="../resources/testharness.js"></script> 5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script> 6 <script src="../resources/testharnessreport.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <script> 9 <script>
10 // Tests that the Notification object exposes the properties per the 10 // Tests that the Notification object exposes the properties per the
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 }); 109 });
110 assert_array_equals(invalidVibrateNotification.vibrate, [100, 200, 0 ]); 110 assert_array_equals(invalidVibrateNotification.vibrate, [100, 200, 0 ]);
111 111
112 // Notification actions should only be supported for persistent noti fications. 112 // Notification actions should only be supported for persistent noti fications.
113 assert_throws(new TypeError(), function() { 113 assert_throws(new TypeError(), function() {
114 new Notification("My Notification", { 114 new Notification("My Notification", {
115 actions: [{ action: "foo", title: "Foo" }] 115 actions: [{ action: "foo", title: "Foo" }]
116 }); 116 });
117 }, 'Providing non-empty `actions` for a non-persistent notification should throw a TypeError.'); 117 }, 'Providing non-empty `actions` for a non-persistent notification should throw a TypeError.');
118 118
119 // Notification actions should only support the placeholder attribut e if they are type text.
120 assert_throws(new TypeError(), function() {
121 new Notification("My Notification", {
122 actions: [{ action: "foo", title: "Foo", placeholder: "I'm s orry, Dave." }]
123 });
124 }, 'Providing a placeholder for an action that is not type text shou ld throw a TypeError.');
125
126 // Notification actions should not accept invalid types.
127 assert_throws(new TypeError(), function() {
128 new Notification("My Notification", {
129 actions: [{ type: "blah", action: "foo", title: "Foo" }]
130 });
131 }, 'Providing an invalid type for an action should throw a TypeError .');
132
119 }, 'Checks the properties exposed on the Notification object.'); 133 }, 'Checks the properties exposed on the Notification object.');
120 </script> 134 </script>
121 </body> 135 </body>
122 </html> 136 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698