Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: ui/message_center/views/message_center_view_unittest.cc

Issue 18003003: Message center re-organized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(&notification); 142 notifications.insert(&notification);
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, /* buttons_on_top = */ false));
dewittj 2013/07/16 00:21:29 I believe the style is without spaces in the /**/
sidharthms 2013/07/16 01:03:20 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698