Index: content/shell/browser/layout_test/layout_test_notification_manager.cc |
diff --git a/content/shell/browser/layout_test/layout_test_notification_manager.cc b/content/shell/browser/layout_test/layout_test_notification_manager.cc |
index f4f1864b15456d64180cb520fdec725a35079c51..701b24b9fb6be227118e9e0cb4d2aac1f7b83c99 100644 |
--- a/content/shell/browser/layout_test/layout_test_notification_manager.cc |
+++ b/content/shell/browser/layout_test/layout_test_notification_manager.cc |
@@ -134,6 +134,24 @@ void LayoutTestNotificationManager::SimulateClick(const std::string& title, |
base::Bind(&OnEventDispatchComplete)); |
} |
+void LayoutTestNotificationManager::SimulateClose(const std::string& title, |
+ bool by_user) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ const auto& persistent_iterator = persistent_notifications_.find(title); |
+ if (persistent_iterator == persistent_notifications_.end()) |
+ return; |
+ |
+ const PersistentNotification& notification = persistent_iterator->second; |
+ content::NotificationEventDispatcher::GetInstance() |
+ ->DispatchNotificationCloseEvent( |
+ notification.browser_context, |
+ notification.persistent_id, |
+ notification.origin, |
+ by_user, |
+ base::Bind(&OnEventDispatchComplete)); |
+} |
+ |
blink::WebNotificationPermission |
LayoutTestNotificationManager::CheckPermissionOnUIThread( |
BrowserContext* browser_context, |