| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers())); | 129 ASSERT_EQ(0u, notification_list()->NotificationCount(blockers())); |
| 130 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers())); | 130 ASSERT_EQ(0u, notification_list()->UnreadCount(blockers())); |
| 131 | 131 |
| 132 std::string id0 = AddNotification(); | 132 std::string id0 = AddNotification(); |
| 133 EXPECT_EQ(1u, notification_list()->NotificationCount(blockers())); | 133 EXPECT_EQ(1u, notification_list()->NotificationCount(blockers())); |
| 134 std::string id1 = AddNotification(); | 134 std::string id1 = AddNotification(); |
| 135 EXPECT_EQ(2u, notification_list()->NotificationCount(blockers())); | 135 EXPECT_EQ(2u, notification_list()->NotificationCount(blockers())); |
| 136 EXPECT_EQ(2u, notification_list()->UnreadCount(blockers())); | 136 EXPECT_EQ(2u, notification_list()->UnreadCount(blockers())); |
| 137 | 137 |
| 138 EXPECT_TRUE(notification_list()->HasPopupNotifications(blockers())); | 138 EXPECT_TRUE(notification_list()->HasPopupNotifications(blockers())); |
| 139 EXPECT_TRUE(notification_list()->HasNotification(id0)); | 139 EXPECT_TRUE(notification_list()->GetNotificationById(id0)); |
| 140 EXPECT_TRUE(notification_list()->HasNotification(id1)); | 140 EXPECT_TRUE(notification_list()->GetNotificationById(id1)); |
| 141 EXPECT_FALSE(notification_list()->HasNotification(id1 + "foo")); | 141 EXPECT_FALSE(notification_list()->GetNotificationById(id1 + "foo")); |
| 142 | 142 |
| 143 EXPECT_EQ(2u, GetPopupCounts()); | 143 EXPECT_EQ(2u, GetPopupCounts()); |
| 144 | 144 |
| 145 notification_list()->MarkSinglePopupAsShown(id0, true); | 145 notification_list()->MarkSinglePopupAsShown(id0, true); |
| 146 notification_list()->MarkSinglePopupAsShown(id1, true); | 146 notification_list()->MarkSinglePopupAsShown(id1, true); |
| 147 EXPECT_EQ(2u, notification_list()->NotificationCount(blockers())); | 147 EXPECT_EQ(2u, notification_list()->NotificationCount(blockers())); |
| 148 EXPECT_EQ(0u, GetPopupCounts()); | 148 EXPECT_EQ(0u, GetPopupCounts()); |
| 149 | 149 |
| 150 notification_list()->RemoveNotification(id0); | 150 notification_list()->RemoveNotification(id0); |
| 151 EXPECT_EQ(1u, notification_list()->NotificationCount(blockers())); | 151 EXPECT_EQ(1u, notification_list()->NotificationCount(blockers())); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 NULL)); | 713 NULL)); |
| 714 notification_list()->AddNotification(updated_notification.Pass()); | 714 notification_list()->AddNotification(updated_notification.Pass()); |
| 715 | 715 |
| 716 EXPECT_FALSE(notification_list()->HasNotificationOfType( | 716 EXPECT_FALSE(notification_list()->HasNotificationOfType( |
| 717 id, message_center::NOTIFICATION_TYPE_SIMPLE)); | 717 id, message_center::NOTIFICATION_TYPE_SIMPLE)); |
| 718 EXPECT_TRUE(notification_list()->HasNotificationOfType( | 718 EXPECT_TRUE(notification_list()->HasNotificationOfType( |
| 719 id, message_center::NOTIFICATION_TYPE_PROGRESS)); | 719 id, message_center::NOTIFICATION_TYPE_PROGRESS)); |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace message_center | 722 } // namespace message_center |
| OLD | NEW |