| 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 0cf8fa190745a180bc3410ba5cc359529bdbf093..0a70f0261aa54f5d8597b6dd440abbb1a3a9b19e 100644
|
| --- a/chrome/browser/notifications/platform_notification_service_browsertest.cc
|
| +++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc
|
| @@ -87,6 +87,7 @@ void InfoBarResponder::Respond(ConfirmInfoBarDelegate* delegate) {
|
| // Dimensions of the icon.png resource in the notification test data directory.
|
| const int kIconWidth = 100;
|
| const int kIconHeight = 100;
|
| +const int kNotificationVibratePattern[] = { 100, 200, 300 };
|
|
|
| class PlatformNotificationServiceBrowserTest : public InProcessBrowserTest {
|
| public:
|
| @@ -271,6 +272,32 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
|
| + WebNotificationOptionsVibratePattern) {
|
| + std::string script_result;
|
| +
|
| + InfoBarResponder accepting_responder(browser(), 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(kNotificationVibratePattern),
|
| + notification.vibrate_pattern().size());
|
| + for (size_t i = 0; i < arraysize(kNotificationVibratePattern); ++i) {
|
| + EXPECT_EQ(kNotificationVibratePattern[i],
|
| + notification.vibrate_pattern()[i]);
|
| + }
|
| +}
|
| +
|
| +IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
|
| CloseDisplayedPersistentNotification) {
|
| std::string script_result;
|
|
|
|
|