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

Unified Diff: ash/system/web_notification/web_notification_tray_unittest.cc

Issue 12391041: Fix ManyPopupNotifications test with --enable-rich-notifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Notice that my file moved. Created 7 years, 10 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
« no previous file with comments | « no previous file | ui/message_center/views/message_popup_collection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/web_notification/web_notification_tray_unittest.cc
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc
index e3e8e0392438d4dc660d7e647d43d38e8cafb1f0..b58845c587758a6ac515bbe5b8a86c10e7be9450 100644
--- a/ash/system/web_notification/web_notification_tray_unittest.cc
+++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -13,10 +13,12 @@
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "ui/message_center/message_center_tray.h"
+#include "ui/message_center/message_center_util.h"
#include "ui/message_center/notification_list.h"
#include "ui/message_center/notification_types.h"
#include "ui/message_center/views/message_center_bubble.h"
#include "ui/message_center/views/message_popup_bubble.h"
+#include "ui/message_center/views/message_popup_collection.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
@@ -219,8 +221,16 @@ TEST_F(WebNotificationTrayTest, ManyPopupNotifications) {
EXPECT_TRUE(tray->IsPopupVisible());
EXPECT_EQ(notifications_to_add,
get_message_center()->NotificationCount());
- EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications,
- tray->GetPopupBubbleForTest()->NumMessageViewsForTest());
+ if (message_center::IsRichNotificationEnabled()) {
+ NotificationList::Delegate* list_delegate =
+ tray->popup_collection_.get()->list_delegate_;
+ NotificationList::PopupNotifications popups =
+ list_delegate->GetNotificationList()->GetPopupNotifications();
+ EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, popups.size());
+ } else {
+ EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications,
+ tray->GetPopupBubbleForTest()->NumMessageViewsForTest());
+ }
get_message_center()->SetDelegate(NULL);
get_message_center()->notification_list()->RemoveAllNotifications();
}
« no previous file with comments | « no previous file | ui/message_center/views/message_popup_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698