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 a70e818510478fc4a550c742f9e47697a210b247..8560aeb85eed4cf6feffdf972edb63e0f5904982 100644 |
--- a/LayoutTests/http/tests/notifications/notification-properties.html |
+++ b/LayoutTests/http/tests/notifications/notification-properties.html |
@@ -66,6 +66,34 @@ |
// Setting an empty string as the tag should be equal to not setting the tag at all. |
assert_equals(noTagNotification.tag, emptyTagNotification.tag); |
+ var vibrateNotification = new Notification("My Notification", { |
+ vibrate: 1000 |
+ }); |
+ |
+ // vibrate pattern should be returned in serialized form. |
+ assert_equals(1000, vibrateNotification.vibrate); |
+ |
+ // Tests that it must be a valid vibration sequence. |
+ var pattern = new Array(100, 200, 300); |
+ var sequenceVibrateNotification = new Notification("My Notification", { |
+ vibrate: pattern |
+ }); |
+ assert_array_equals(pattern, sequenceVibrateNotification.vibrate); |
+ |
+ // Invalid vibrate pattern should be reset to 0. |
+ var invalidVibrateNotification = new Notification("My Notification", { |
+ vibrate: [100, 200, "invalid"] |
+ }); |
+ assert_array_equals([100, 200, 0], invalidVibrateNotification.vibrate); |
+ |
+ // Verifying the exception throwing behavior, when slient set true and vibrate is presented. |
+ assert_throws(new TypeError(), function() { |
+ var notification = new Notification("My Notification", { |
+ silent: true, |
+ vibrate: 1000 |
+ }); |
+ }, 'Set vibrate, when slient is true.'); |
+ |
}, 'Checks the properties exposed on the Notification object.'); |
</script> |
</body> |