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

Unified Diff: content/shell/browser/layout_test/layout_test_notification_manager.cc

Issue 2403893002: Add layout test for reply property of notificationclick event (Closed)
Patch Set: Add layout test for reply property of notificationclick event Created 4 years, 2 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: 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 81ec335d07e238aa96dc52fe69f366f5465f24c8..b1c8aaef082f14fc02e744b8dbb952dfb128b3bb 100644
--- a/content/shell/browser/layout_test/layout_test_notification_manager.cc
+++ b/content/shell/browser/layout_test/layout_test_notification_manager.cc
@@ -94,7 +94,8 @@ bool LayoutTestNotificationManager::GetDisplayedPersistentNotifications(
}
void LayoutTestNotificationManager::SimulateClick(const std::string& title,
- int action_index) {
+ int action_index,
+ const std::string& reply) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const auto notification_id_iter = notification_id_map_.find(title);
@@ -112,10 +113,11 @@ void LayoutTestNotificationManager::SimulateClick(const std::string& title,
const PersistentNotification& notification = persistent_iter->second;
content::NotificationEventDispatcher::GetInstance()
- ->DispatchNotificationClickEvent(notification.browser_context,
- notification_id, notification.origin,
- action_index, base::NullableString16(),
- base::Bind(&OnEventDispatchComplete));
+ ->DispatchNotificationClickEvent(
+ notification.browser_context, notification_id, notification.origin,
+ action_index, base::NullableString16(base::UTF8ToUTF16(reply),
+ false /* is_null */),
+ base::Bind(&OnEventDispatchComplete));
} else if (non_persistent_iter != non_persistent_notifications_.end()) {
DCHECK_EQ(action_index, -1) << "Action buttons are only supported for "
"persistent notifications";

Powered by Google App Engine
This is Rietveld 408576698