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 af386a887c71a9320eaa87182fdb44e6ce5cfe8b..1722cc22d78d1819870b06c33102d9568f142289 100644 |
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc |
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc |
@@ -324,6 +324,23 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
} |
IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
+ UserClosesPersistentNotification) { |
+ ASSERT_NO_FATAL_FAILURE(GrantNotificationPermissionForTest()); |
+ |
+ std::string script_result; |
+ ASSERT_TRUE( |
+ RunScript("DisplayPersistentNotification('close_test')", &script_result)); |
+ EXPECT_EQ("ok", script_result); |
+ |
+ ASSERT_EQ(1u, ui_manager()->GetNotificationCount()); |
+ const Notification& notification = ui_manager()->GetNotificationAt(0); |
+ notification.delegate()->Close(true); |
Peter Beverloo
2016/01/27 19:03:57
nit: "true /* by_user */"
Nina
2016/01/28 11:59:01
Done.
|
+ |
+ ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result)); |
+ EXPECT_EQ("closing notification: close_test", script_result); |
+} |
+ |
+IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest, |
TestDisplayOriginContextMessage) { |
RequestAndAcceptPermission(); |