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

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

Issue 1095093002: Add layouttest for notification properties of persistent notification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 38e05362905fb71bb7a4053658d9e66c1f03317f..f54a903dc501b4142c5e42c88db5ef32ee43ea90 100644
--- a/LayoutTests/http/tests/notifications/notification-properties.html
+++ b/LayoutTests/http/tests/notifications/notification-properties.html
@@ -84,6 +84,16 @@
});
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", {

Powered by Google App Engine
This is Rietveld 408576698