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

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

Issue 14631005: Enable users of NotificationUIManager to specify binary images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for relanding. 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(&notification); 142 notifications.insert(&notification);
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
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
OLDNEW
« no previous file with comments | « ui/message_center/notification_types.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