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

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

Issue 2776933006: CrOS: Do not allow notifications to be added during shutdown. (Closed)
Patch Set: Trybots. Created 3 years, 9 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/notification_test_util.cc
diff --git a/chrome/browser/notifications/notification_test_util.cc b/chrome/browser/notifications/notification_test_util.cc
index 491c54e7ff1ccc1657b06a5dcc0304effdaa93e1..f9c31b6a7d02708a0264c0c5284a5096e165a087 100644
--- a/chrome/browser/notifications/notification_test_util.cc
+++ b/chrome/browser/notifications/notification_test_util.cc
@@ -52,6 +52,9 @@ bool StubNotificationUIManager::SilentDismissById(
void StubNotificationUIManager::Add(const Notification& notification,
Profile* profile) {
+ if (is_shutdown_started_)
+ return;
+
notifications_.push_back(std::make_pair(
notification, NotificationUIManager::GetProfileID(profile)));
@@ -154,6 +157,11 @@ void StubNotificationUIManager::CancelAll() {
notifications_.clear();
}
+void StubNotificationUIManager::StartShutdown() {
+ is_shutdown_started_ = true;
+ CancelAll();
+}
+
FullscreenStateWaiter::FullscreenStateWaiter(
Browser* browser, bool desired_state)
: browser_(browser),
« no previous file with comments | « chrome/browser/notifications/notification_test_util.h ('k') | chrome/browser/notifications/notification_ui_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698