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

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

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 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/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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 }; 122 };
123 123
124 MessageCenterViewTest::MessageCenterViewTest() { 124 MessageCenterViewTest::MessageCenterViewTest() {
125 } 125 }
126 126
127 MessageCenterViewTest::~MessageCenterViewTest() { 127 MessageCenterViewTest::~MessageCenterViewTest() {
128 } 128 }
129 129
130 void MessageCenterViewTest::SetUp() { 130 void MessageCenterViewTest::SetUp() {
131 // Create a dummy notification. 131 // Create a dummy notification.
132 Notification notification(NOTIFICATION_TYPE_SIMPLE, 132 Notification notification(
133 std::string("notification id"), 133 NOTIFICATION_TYPE_SIMPLE, std::string("notification id"),
134 base::UTF8ToUTF16("title"), 134 base::UTF8ToUTF16("title"), base::UTF8ToUTF16("message"), gfx::Image(),
135 base::UTF8ToUTF16("message"), 135 base::UTF8ToUTF16("display source"), GURL(),
136 gfx::Image(), 136 NotifierId(NotifierId::APPLICATION, "extension_id"),
137 base::UTF8ToUTF16("display source"), 137 message_center::RichNotificationData(), NULL);
138 NotifierId(NotifierId::APPLICATION, "extension_id"),
139 message_center::RichNotificationData(),
140 NULL);
141 138
142 // ...and a list for it. 139 // ...and a list for it.
143 NotificationList::Notifications notifications; 140 NotificationList::Notifications notifications;
144 notifications.insert(&notification); 141 notifications.insert(&notification);
145 142
146 // Then create a new MessageCenterView with that single notification. 143 // Then create a new MessageCenterView with that single notification.
147 base::string16 title; 144 base::string16 title;
148 message_center_view_.reset(new MessageCenterView( 145 message_center_view_.reset(new MessageCenterView(
149 &message_center_, NULL, 100, false, /*top_down =*/false, title)); 146 &message_center_, NULL, 100, false, /*top_down =*/false, title));
150 message_center_view_->SetNotifications(notifications); 147 message_center_view_->SetNotifications(notifications);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very 230 // GetHeightForWidth() calls per descendant NotificationView. 20 is a very
234 // large number corresponding to the current reality. That number will be 231 // large number corresponding to the current reality. That number will be
235 // ratcheted down over time as the code improves. 232 // ratcheted down over time as the code improves.
236 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2); 233 EXPECT_LE(GetCallCount(LAYOUT), GetNotificationCount() * 2);
237 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) + 234 EXPECT_LE(GetCallCount(GET_PREFERRED_SIZE) +
238 GetCallCount(GET_HEIGHT_FOR_WIDTH), 235 GetCallCount(GET_HEIGHT_FOR_WIDTH),
239 GetNotificationCount() * 20); 236 GetNotificationCount() * 20);
240 } 237 }
241 238
242 } // namespace message_center 239 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/constants.h ('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