OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <map> | 5 #include <map> |
6 #include <memory> | 6 #include <memory> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void MessageListViewTest::UpdateNotificationSize( | 165 void MessageListViewTest::UpdateNotificationSize( |
166 const std::string& notification_id) { | 166 const std::string& notification_id) { |
167 // For this test, this method should not be invoked. | 167 // For this test, this method should not be invoked. |
168 NOTREACHED(); | 168 NOTREACHED(); |
169 } | 169 } |
170 | 170 |
171 /* Unit tests *****************************************************************/ | 171 /* Unit tests *****************************************************************/ |
172 | 172 |
173 TEST_F(MessageListViewTest, AddNotification) { | 173 TEST_F(MessageListViewTest, AddNotification) { |
174 // Create a dummy notification. | 174 // Create a dummy notification. |
175 auto notification_view = CreateNotificationView( | 175 auto* notification_view = CreateNotificationView( |
176 Notification(NOTIFICATION_TYPE_SIMPLE, std::string(kNotificationId1), | 176 Notification(NOTIFICATION_TYPE_SIMPLE, std::string(kNotificationId1), |
177 base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message1"), | 177 base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message1"), |
178 gfx::Image(), base::UTF8ToUTF16("display source"), GURL(), | 178 gfx::Image(), base::UTF8ToUTF16("display source"), GURL(), |
179 NotifierId(NotifierId::APPLICATION, "extension_id"), | 179 NotifierId(NotifierId::APPLICATION, "extension_id"), |
180 message_center::RichNotificationData(), nullptr)); | 180 message_center::RichNotificationData(), nullptr)); |
181 | 181 |
182 EXPECT_EQ(0, message_list_view()->child_count()); | 182 EXPECT_EQ(0, message_list_view()->child_count()); |
183 EXPECT_FALSE(message_list_view()->Contains(notification_view)); | 183 EXPECT_FALSE(message_list_view()->Contains(notification_view)); |
184 | 184 |
185 // Add a notification. | 185 // Add a notification. |
186 message_list_view()->AddNotificationAt(notification_view, 0); | 186 message_list_view()->AddNotificationAt(notification_view, 0); |
187 | 187 |
188 EXPECT_EQ(1, message_list_view()->child_count()); | 188 EXPECT_EQ(1, message_list_view()->child_count()); |
189 EXPECT_TRUE(message_list_view()->Contains(notification_view)); | 189 EXPECT_TRUE(message_list_view()->Contains(notification_view)); |
190 } | 190 } |
191 | 191 |
192 } // namespace | 192 } // namespace |
OLD | NEW |