Index: chrome/browser/notifications/platform_notification_service_unittest.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc |
index 40a8eec1f28bd88a040c72e566404bb9522caf33..d3cfdeb8d2bb78bf84bdd21a237144e407ac6218 100644 |
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc |
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc |
@@ -17,6 +17,8 @@ |
namespace { |
+const int kNotificationVibrationPattern[] = { 100, 200, 300 }; |
+ |
#if !defined(OS_ANDROID) |
const int64_t kPersistentNotificationId = 42; |
#endif |
@@ -157,9 +159,14 @@ TEST_F(PlatformNotificationServiceTest, PersistentNotificationDisplay) { |
#endif // !defined(OS_ANDROID) |
TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) { |
+ std::vector<int> vibration_pattern( |
+ kNotificationVibrationPattern, |
+ kNotificationVibrationPattern + arraysize(kNotificationVibrationPattern)); |
+ |
content::PlatformNotificationData notification_data; |
notification_data.title = base::ASCIIToUTF16("My notification's title"); |
notification_data.body = base::ASCIIToUTF16("Hello, world!"); |
+ notification_data.vibration_pattern = vibration_pattern; |
notification_data.silent = true; |
MockDesktopNotificationDelegate* delegate |
@@ -179,6 +186,11 @@ TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) { |
base::UTF16ToUTF8(notification.title())); |
EXPECT_EQ("Hello, world!", |
base::UTF16ToUTF8(notification.message())); |
+ |
+ ASSERT_EQ(vibration_pattern.size(), notification.vibration_pattern().size()); |
+ for (size_t i = 0; i < vibration_pattern.size(); ++i) |
+ EXPECT_EQ(vibration_pattern[i], notification.vibration_pattern()[i]); |
+ |
EXPECT_TRUE(notification.silent()); |
} |