Index: chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc |
diff --git a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc |
index 0c3d7f04c1a12ac37509381b8cd2a161d502cf97..d0ad7d2b4ae2550c5b813dbc1af6e218fe11e038 100644 |
--- a/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc |
+++ b/chrome/browser/ui/views/message_center/web_notification_tray_browsertest.cc |
@@ -96,6 +96,11 @@ class WebNotificationTrayTest : public InProcessBrowserTest { |
g_browser_process->notification_ui_manager()->CancelById(id); |
} |
+ bool HasNotification(message_center::MessageCenter* message_center, |
+ const std::string& id) { |
+ return message_center->FindVisibleNotificationById(id) != NULL; |
+ } |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(WebNotificationTrayTest); |
}; |
@@ -111,28 +116,28 @@ IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, WebNotifications) { |
// Add a notification. |
AddNotification("test_id1", "replace_id1"); |
EXPECT_EQ(1u, message_center->NotificationCount()); |
- EXPECT_TRUE(message_center->HasNotification("test_id1")); |
- EXPECT_FALSE(message_center->HasNotification("test_id2")); |
+ EXPECT_TRUE(HasNotification(message_center, "test_id1")); |
+ EXPECT_FALSE(HasNotification(message_center, "test_id2")); |
AddNotification("test_id2", "replace_id2"); |
AddNotification("test_id2", "replace_id2"); |
EXPECT_EQ(2u, message_center->NotificationCount()); |
- EXPECT_TRUE(message_center->HasNotification("test_id2")); |
+ EXPECT_TRUE(HasNotification(message_center, "test_id1")); |
// Ensure that updating a notification does not affect the count. |
UpdateNotification("replace_id2", "test_id3"); |
UpdateNotification("replace_id2", "test_id3"); |
EXPECT_EQ(2u, message_center->NotificationCount()); |
- EXPECT_FALSE(message_center->HasNotification("test_id2")); |
+ EXPECT_FALSE(HasNotification(message_center, "test_id2")); |
// Ensure that Removing the first notification removes it from the tray. |
RemoveNotification("test_id1"); |
- EXPECT_FALSE(message_center->HasNotification("test_id1")); |
+ EXPECT_FALSE(HasNotification(message_center, "test_id1")); |
EXPECT_EQ(1u, message_center->NotificationCount()); |
// Remove the remaining notification. |
RemoveNotification("test_id3"); |
EXPECT_EQ(0u, message_center->NotificationCount()); |
- EXPECT_FALSE(message_center->HasNotification("test_id3")); |
+ EXPECT_FALSE(HasNotification(message_center, "test_id1")); |
} |
IN_PROC_BROWSER_TEST_F(WebNotificationTrayTest, WebNotificationPopupBubble) { |