Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5814)

Unified Diff: chrome/browser/notifications/platform_notification_service_browsertest.cc

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Recovered a lost piece of logging. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698