Index: chrome/browser/notifications/message_center_notifications_unittest.cc |
diff --git a/chrome/browser/notifications/message_center_notifications_unittest.cc b/chrome/browser/notifications/message_center_notifications_unittest.cc |
index 742031378daffea905c851c2aa577578d4c2f5a4..459ec30ddd6258f63e30a2909482be2335d54571 100644 |
--- a/chrome/browser/notifications/message_center_notifications_unittest.cc |
+++ b/chrome/browser/notifications/message_center_notifications_unittest.cc |
@@ -104,6 +104,20 @@ TEST_F(MessageCenterNotificationManagerTest, SetupNotificationManager) { |
notification_manager()->Add(GetANotification("test"), &profile); |
} |
+TEST_F(MessageCenterNotificationManagerTest, AddNotificationOnShutdown) { |
+ TestingProfile profile; |
+ EXPECT_TRUE(message_center()->NotificationCount() == 0); |
+ notification_manager()->Add(GetANotification("test"), &profile); |
+ EXPECT_TRUE(message_center()->NotificationCount() == 1); |
+ |
+ // Verify the number of notifications does not increase when trying to add a |
+ // notifcation on shutdown. |
+ TestingBrowserProcess::GetGlobal()->SetShuttingDown(true); |
+ notification_manager()->Add(GetANotification("test2"), &profile); |
+ EXPECT_TRUE(message_center()->NotificationCount() == 1); |
+ TestingBrowserProcess::GetGlobal()->SetShuttingDown(false); |
+} |
+ |
TEST_F(MessageCenterNotificationManagerTest, UpdateNotification) { |
TestingProfile profile; |
EXPECT_TRUE(message_center()->NotificationCount() == 0); |