| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 MessageCenterViewTest::~MessageCenterViewTest() { | 125 MessageCenterViewTest::~MessageCenterViewTest() { |
| 126 } | 126 } |
| 127 | 127 |
| 128 void MessageCenterViewTest::SetUp() { | 128 void MessageCenterViewTest::SetUp() { |
| 129 // Create a dummy notification. | 129 // Create a dummy notification. |
| 130 Notification notification(NOTIFICATION_TYPE_SIMPLE, | 130 Notification notification(NOTIFICATION_TYPE_SIMPLE, |
| 131 std::string("notification id"), | 131 std::string("notification id"), |
| 132 UTF8ToUTF16("title"), | 132 UTF8ToUTF16("title"), |
| 133 UTF8ToUTF16("message"), | 133 UTF8ToUTF16("message"), |
| 134 gfx::Image(), |
| 134 UTF8ToUTF16("display source"), | 135 UTF8ToUTF16("display source"), |
| 135 std::string("extension id"), | 136 std::string("extension id"), |
| 136 NULL, | 137 NULL, |
| 137 NULL); | 138 NULL); |
| 138 | 139 |
| 139 // ...and a list for it. | 140 // ...and a list for it. |
| 140 NotificationList::Notifications notifications; | 141 NotificationList::Notifications notifications; |
| 141 notifications.insert(¬ification); | 142 notifications.insert(¬ification); |
| 142 | 143 |
| 143 // Then create a new MessageCenterView with that single notification. | 144 // Then create a new MessageCenterView with that single notification. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very | 196 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very |
| 196 // large number corresponding to the current reality. That number will be | 197 // large number corresponding to the current reality. That number will be |
| 197 // ratcheted down over time as the code improves. | 198 // ratcheted down over time as the code improves. |
| 198 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); | 199 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); |
| 199 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + | 200 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + |
| 200 GetCallCount(GET_HEIGHT_FOR_WIDTH), | 201 GetCallCount(GET_HEIGHT_FOR_WIDTH), |
| 201 GetNotificationCount() * 20); | 202 GetNotificationCount() * 20); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace message_center | 205 } // namespace message_center |
| OLD | NEW |