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..e47239b505da0c4ba944a58b9105e17e8680892d 100644 |
--- a/chrome/browser/notifications/message_center_notifications_unittest.cc |
+++ b/chrome/browser/notifications/message_center_notifications_unittest.cc |
@@ -51,7 +51,6 @@ class MessageCenterNotificationManagerTest : public BrowserWithTestWindowTest { |
MessageCenter::Initialize(); |
#endif |
- |
TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal(); |
profile_manager_.reset(new TestingProfileManager(browser_process)); |
ASSERT_TRUE(profile_manager_->SetUp()); |
@@ -104,6 +103,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. |
+ notification_manager()->StartShutdown(); |
+ EXPECT_TRUE(message_center()->NotificationCount() == 0); |
+ notification_manager()->Add(GetANotification("test2"), &profile); |
+ EXPECT_TRUE(message_center()->NotificationCount() == 0); |
+} |
+ |
TEST_F(MessageCenterNotificationManagerTest, UpdateNotification) { |
TestingProfile profile; |
EXPECT_TRUE(message_center()->NotificationCount() == 0); |