Index: chrome/browser/notifications/platform_notification_service_browsertest.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_browsertest.cc b/chrome/browser/notifications/platform_notification_service_browsertest.cc |
index 335e838873a49bf4ec492cb315af61f420244d9c..98c20d03a017567069adf3e6ee3764bda43adf94 100644 |
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc |
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc |
@@ -30,6 +30,8 @@ |
const int kIconWidth = 100; |
const int kIconHeight = 100; |
+const int kNotificationVibrationPattern[] = { 100, 200, 300 }; |
+ |
class PlatformNotificationServiceBrowserTest : public InProcessBrowserTest { |
public: |
PlatformNotificationServiceBrowserTest(); |
@@ -219,6 +221,32 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
} |
IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
+ WebNotificationOptionsVibrationPattern) { |
+ std::string script_result; |
+ |
+ InfoBarResponder accepting_responder(GetInfoBarService(), true); |
+ ASSERT_TRUE(RunScript("RequestPermission()", &script_result)); |
+ EXPECT_EQ("granted", script_result); |
+ |
+ ASSERT_TRUE(RunScript("DisplayPersistentNotificationVibrate()", |
+ &script_result)); |
+ EXPECT_EQ("ok", script_result); |
+ |
+ ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
+ |
+ const Notification& notification = ui_manager()->GetNotificationAt(0); |
+ EXPECT_EQ("Title", base::UTF16ToUTF8(notification.title())); |
+ EXPECT_EQ("Contents", base::UTF16ToUTF8(notification.message())); |
+ |
+ ASSERT_EQ(arraysize(kNotificationVibrationPattern), |
+ notification.vibration_pattern().size()); |
+ for (size_t i = 0; i < arraysize(kNotificationVibrationPattern); ++i) { |
+ EXPECT_EQ(kNotificationVibrationPattern[i], |
+ notification.vibration_pattern()[i]); |
+ } |
+} |
+ |
+IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
CloseDisplayedPersistentNotification) { |
std::string script_result; |