Chromium Code Reviews| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 std::string("extension id"), | 136 std::string("extension id"), |
| 137 message_center::RichNotificationData(), | 137 message_center::RichNotificationData(), |
| 138 NULL); | 138 NULL); |
| 139 | 139 |
| 140 // ...and a list for it. | 140 // ...and a list for it. |
| 141 NotificationList::Notifications notifications; | 141 NotificationList::Notifications notifications; |
| 142 notifications.insert(¬ification); | 142 notifications.insert(¬ification); |
| 143 | 143 |
| 144 // Then create a new MessageCenterView with that single notification. | 144 // Then create a new MessageCenterView with that single notification. |
| 145 message_center_view_.reset(new MessageCenterView( | 145 message_center_view_.reset(new MessageCenterView( |
| 146 &message_center_, NULL, 100, false)); | 146 &message_center_, NULL, 100, false, false /* buttons not at top */)); |
|
dewittj
2013/07/15 18:38:58
In this case, either do a //-style comment at the
sidharthms
2013/07/15 23:16:37
Done.
| |
| 147 message_center_view_->SetNotifications(notifications); | 147 message_center_view_->SetNotifications(notifications); |
| 148 | 148 |
| 149 // Remove and delete the NotificationView now owned by the MessageCenterView's | 149 // Remove and delete the NotificationView now owned by the MessageCenterView's |
| 150 // MessageListView and replace it with an instrumented MockNotificationView | 150 // MessageListView and replace it with an instrumented MockNotificationView |
| 151 // that will become owned by the MessageListView. | 151 // that will become owned by the MessageListView. |
| 152 MockNotificationView* mock; | 152 MockNotificationView* mock; |
| 153 mock = new MockNotificationView(notification, &message_center_, this, 42); | 153 mock = new MockNotificationView(notification, &message_center_, this, 42); |
| 154 message_center_view_->message_views_.push_back(mock); | 154 message_center_view_->message_views_.push_back(mock); |
| 155 message_center_view_->SetNotificationViewForTest(mock); | 155 message_center_view_->SetNotificationViewForTest(mock); |
| 156 } | 156 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very | 197 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very |
| 198 // large number corresponding to the current reality. That number will be | 198 // large number corresponding to the current reality. That number will be |
| 199 // ratcheted down over time as the code improves. | 199 // ratcheted down over time as the code improves. |
| 200 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); | 200 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); |
| 201 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + | 201 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + |
| 202 GetCallCount(GET_HEIGHT_FOR_WIDTH), | 202 GetCallCount(GET_HEIGHT_FOR_WIDTH), |
| 203 GetNotificationCount() * 20); | 203 GetNotificationCount() * 20); |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace message_center | 206 } // namespace message_center |
| OLD | NEW |