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

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

Issue 2534443002: Use notification display service to collect persistent notifications. (Closed)
Patch Set: revert unit test Created 4 years 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/notification_test_util.cc
diff --git a/chrome/browser/notifications/notification_test_util.cc b/chrome/browser/notifications/notification_test_util.cc
index ad254f2d2d6dff2e3babfc5df1d0629519a8fdd6..eea92f247a58562ee6ac8114dfdbc32fd0e9d864 100644
--- a/chrome/browser/notifications/notification_test_util.cc
+++ b/chrome/browser/notifications/notification_test_util.cc
@@ -37,6 +37,19 @@ void StubNotificationUIManager::SetNotificationAddedCallback(
notification_added_callback_ = callback;
}
+bool StubNotificationUIManager::ClearNotificationById(
+ const std::string& delegate_id,
+ ProfileID profile_id) {
+ auto iter = notifications_.begin();
+ for (; iter != notifications_.end(); ++iter) {
+ if (iter->first.delegate_id() != delegate_id || iter->second != profile_id)
+ continue;
+ notifications_.erase(iter);
+ return true;
+ }
+ return false;
+}
+
void StubNotificationUIManager::Add(const Notification& notification,
Profile* profile) {
notifications_.push_back(std::make_pair(

Powered by Google App Engine
This is Rietveld 408576698