OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/message_center/notification_list.h" | 5 #include "ui/message_center/notification_list.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 for (size_t i = 0; i < kMaxVisiblePopupNotifications; ++i, ++iter) { | 288 for (size_t i = 0; i < kMaxVisiblePopupNotifications; ++i, ++iter) { |
289 EXPECT_EQ(ids[i], (*iter)->id()) << i; | 289 EXPECT_EQ(ids[i], (*iter)->id()) << i; |
290 } | 290 } |
291 | 291 |
292 for (NotificationList::PopupNotifications::const_iterator iter = | 292 for (NotificationList::PopupNotifications::const_iterator iter = |
293 popups.begin(); iter != popups.end(); ++iter) { | 293 popups.begin(); iter != popups.end(); ++iter) { |
294 notification_list()->MarkSinglePopupAsShown((*iter)->id(), false); | 294 notification_list()->MarkSinglePopupAsShown((*iter)->id(), false); |
295 } | 295 } |
296 popups.clear(); | 296 popups.clear(); |
297 popups = GetPopups(); | 297 popups = GetPopups(); |
298 EXPECT_EQ(1u, popups.size()); | 298 ASSERT_EQ(1u, popups.size()); |
299 EXPECT_EQ(ids[ids.size() - 1], (*popups.begin())->id()); | 299 EXPECT_EQ(ids.back(), (*popups.begin())->id()); |
300 } | 300 } |
301 | 301 |
302 TEST_F(NotificationListTest, Priority) { | 302 TEST_F(NotificationListTest, Priority) { |
303 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers())); | 303 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers())); |
304 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers())); | 304 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers())); |
305 | 305 |
306 // Default priority has the limit on the number of the popups. | 306 // Default priority has the limit on the number of the popups. |
307 for (size_t i = 0; i <= kMaxVisiblePopupNotifications; ++i) | 307 for (size_t i = 0; i <= kMaxVisiblePopupNotifications; ++i) |
308 AddNotification(); | 308 AddNotification(); |
309 EXPECT_EQ(kMaxVisiblePopupNotifications + 1, | 309 EXPECT_EQ(kMaxVisiblePopupNotifications + 1, |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 NotifierId(), RichNotificationData(), NULL)); | 662 NotifierId(), RichNotificationData(), NULL)); |
663 notification_list()->AddNotification(std::move(updated_notification)); | 663 notification_list()->AddNotification(std::move(updated_notification)); |
664 | 664 |
665 EXPECT_FALSE(notification_list()->HasNotificationOfType( | 665 EXPECT_FALSE(notification_list()->HasNotificationOfType( |
666 id, message_center::NOTIFICATION_TYPE_SIMPLE)); | 666 id, message_center::NOTIFICATION_TYPE_SIMPLE)); |
667 EXPECT_TRUE(notification_list()->HasNotificationOfType( | 667 EXPECT_TRUE(notification_list()->HasNotificationOfType( |
668 id, message_center::NOTIFICATION_TYPE_PROGRESS)); | 668 id, message_center::NOTIFICATION_TYPE_PROGRESS)); |
669 } | 669 } |
670 | 670 |
671 } // namespace message_center | 671 } // namespace message_center |
OLD | NEW |