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

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

Issue 1260793007: Generalize validation of developer input for Web Notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix actions 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/serviceworkerregistration-document-actions-throw.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 fb16602e6f5adf2b6780f722574df1cbba5c8c75..0e3bab0db5230c0295d450710460110c54c75f85 100644
--- a/LayoutTests/http/tests/notifications/notification-properties.html
+++ b/LayoutTests/http/tests/notifications/notification-properties.html
@@ -66,13 +66,6 @@
assert_equals(emptyNotification.data, null);
assert_array_equals(emptyNotification.actions, []);
- var invalidIconNotification = new Notification("My Notification", {
- icon: "http://test:test/"
- });
-
- // Invalid icon URLs should be reset to an empty string.
- assert_equals(invalidIconNotification.icon, "");
-
var serializedUrlNotification = new Notification("My Notification", {
icon: "http://example.com"
});
@@ -106,47 +99,6 @@
});
assert_array_equals(invalidVibrateNotification.vibrate, [100, 200, 0]);
- // Invalid vibrate pattern should be sanitized.
- // 1. If the vibration pattern is longer than 100 then truncate it.
- // 2. If the last item in the vibration pattern is a pause then discard it.
- // 3. If any pattern entry is longer than 10000 then truncate it.
- var sanitizedVibrateNotification = new Notification("My Notification", {
- vibrate: Array.apply(null, new Array(101)).map(Number.prototype.valueOf, 20000)
- });
- assert_array_equals(sanitizedVibrateNotification.vibrate,
- Array.apply(null, new Array(99)).map(Number.prototype.valueOf, 10000));
-
- // Verifying the exception throwing behavior, when silent set true and vibrate is presented.
- assert_throws(new TypeError(), function() {
- var notification = new Notification("My Notification", {
- silent: true,
- vibrate: 1000
- });
- }, 'Set vibrate, when silent is true.');
-
- // 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: [{title: "Foo"}]
- });
- }, 'NotificationAction without action.');
- assert_throws(new TypeError(), function() {
- var notification = new Notification("My Notification", {
- actions: [{action: "foo"}]
- });
- }, '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>
</body>
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/serviceworkerregistration-document-actions-throw.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698