| 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..62fdc3808b8561bc7952b9ae6a29e55125a5d432 100644
|
| --- a/LayoutTests/http/tests/notifications/notification-properties.html
|
| +++ b/LayoutTests/http/tests/notifications/notification-properties.html
|
| @@ -43,6 +43,7 @@
|
| assert_equals(emptyNotification.body, "");
|
| assert_equals(emptyNotification.tag, "");
|
| assert_equals(emptyNotification.icon, "");
|
| + assert_equals(notification.vibrate, null);
|
| assert_false(emptyNotification.silent);
|
| assert_equals(emptyNotification.data, null);
|
|
|
| @@ -66,6 +67,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_array_equals(vibrateNotification.vibrate, [1000]);
|
| +
|
| + // 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(sequenceVibrateNotification.vibrate, pattern);
|
| +
|
| + // Invalid vibrate pattern should be reset to 0.
|
| + var invalidVibrateNotification = new Notification("My Notification", {
|
| + vibrate: [100, 200, "invalid"]
|
| + });
|
| + assert_array_equals(invalidVibrateNotification.vibrate, [100, 200, 0]);
|
| +
|
| + // 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.');
|
| +
|
| }, 'Checks the properties exposed on the Notification object.');
|
| </script>
|
| </body>
|
|
|