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

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: Fixed nits 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
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b7a173c8498932753b330129570b7df3130d369a..f30b3d002b2dcbbfd30afc6d4d5e39a3512af336 100644
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc
@@ -334,6 +334,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 /* by_user */);
+
+ ASSERT_TRUE(RunScript("GetMessageFromWorker()", &script_result));
+ EXPECT_EQ("closing notification: close_test", script_result);
+}
+
+IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
TestDisplayOriginContextMessage) {
RequestAndAcceptPermission();
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698