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

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

Issue 15582004: Move NotificationDelegate into message_center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the ever-changing Mac unit tests. Created 7 years, 6 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
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/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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 }; 120 };
121 121
122 MessageCenterViewTest::MessageCenterViewTest() { 122 MessageCenterViewTest::MessageCenterViewTest() {
123 } 123 }
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( 130 Notification notification(NOTIFICATION_TYPE_SIMPLE,
131 NOTIFICATION_TYPE_SIMPLE, 131 std::string("notification id"),
132 std::string("notification id"), 132 UTF8ToUTF16("title"),
133 UTF8ToUTF16("title"), 133 UTF8ToUTF16("message"),
134 UTF8ToUTF16("message"), 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 138
139 // ...and a list for it. 139 // ...and a list for it.
140 NotificationList::Notifications notifications; 140 NotificationList::Notifications notifications;
141 notifications.insert(&notification); 141 notifications.insert(&notification);
142 142
143 // Then create a new MessageCenterView with that single notification. 143 // Then create a new MessageCenterView with that single notification.
144 message_center_view_.reset(new MessageCenterView(&message_center_, 100)); 144 message_center_view_.reset(new MessageCenterView(&message_center_, 100));
145 message_center_view_->SetNotifications(notifications); 145 message_center_view_->SetNotifications(notifications);
146 146
147 // Remove and delete the NotificationView now owned by the MessageCenterView's 147 // Remove and delete the NotificationView now owned by the MessageCenterView's
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very 195 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very
196 // large number corresponding to the current reality. That number will be 196 // large number corresponding to the current reality. That number will be
197 // ratcheted down over time as the code improves. 197 // ratcheted down over time as the code improves.
198 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); 198 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2);
199 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + 199 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) +
200 GetCallCount(GET_HEIGHT_FOR_WIDTH), 200 GetCallCount(GET_HEIGHT_FOR_WIDTH),
201 GetNotificationCount() * 20); 201 GetNotificationCount() * 20);
202 } 202 }
203 203
204 } // namespace message_center 204 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/notification_list_unittest.cc ('k') | ui/message_center/views/message_popup_collection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698