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

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

Issue 1979553003: Consolidate to use MessageView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 "ui/message_center/views/message_center_view.h" 5 #include "ui/message_center/views/message_center_view.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 public: 119 public:
120 MessageCenterViewTest(); 120 MessageCenterViewTest();
121 ~MessageCenterViewTest() override; 121 ~MessageCenterViewTest() override;
122 122
123 void SetUp() override; 123 void SetUp() override;
124 void TearDown() override; 124 void TearDown() override;
125 125
126 MessageCenterView* GetMessageCenterView(); 126 MessageCenterView* GetMessageCenterView();
127 MessageListView* GetMessageListView(); 127 MessageListView* GetMessageListView();
128 FakeMessageCenterImpl* GetMessageCenter() const; 128 FakeMessageCenterImpl* GetMessageCenter() const;
129 NotificationView* GetNotificationView(const std::string& id); 129 MessageView* GetNotificationView(const std::string& id);
130 views::BoundsAnimator* GetAnimator(); 130 views::BoundsAnimator* GetAnimator();
131 int GetNotificationCount(); 131 int GetNotificationCount();
132 int GetCallCount(CallType type); 132 int GetCallCount(CallType type);
133 int GetCalculatedMessageListViewHeight(); 133 int GetCalculatedMessageListViewHeight();
134 void AddNotification(std::unique_ptr<Notification> notification); 134 void AddNotification(std::unique_ptr<Notification> notification);
135 void UpdateNotification(const std::string& notification_id, 135 void UpdateNotification(const std::string& notification_id,
136 std::unique_ptr<Notification> notification); 136 std::unique_ptr<Notification> notification);
137 137
138 // Overridden from MessageCenterController: 138 // Overridden from MessageCenterController:
139 void ClickOnNotification(const std::string& notification_id) override; 139 void ClickOnNotification(const std::string& notification_id) override;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 MessageListView* MessageCenterViewTest::GetMessageListView() { 223 MessageListView* MessageCenterViewTest::GetMessageListView() {
224 return message_center_view_->message_list_view_.get(); 224 return message_center_view_->message_list_view_.get();
225 } 225 }
226 226
227 FakeMessageCenterImpl* MessageCenterViewTest::GetMessageCenter() const { 227 FakeMessageCenterImpl* MessageCenterViewTest::GetMessageCenter() const {
228 return message_center_.get(); 228 return message_center_.get();
229 } 229 }
230 230
231 NotificationView* MessageCenterViewTest::GetNotificationView( 231 MessageView* MessageCenterViewTest::GetNotificationView(const std::string& id) {
232 const std::string& id) {
233 return message_center_view_->notification_views_[id]; 232 return message_center_view_->notification_views_[id];
234 } 233 }
235 234
236 int MessageCenterViewTest::GetCalculatedMessageListViewHeight() { 235 int MessageCenterViewTest::GetCalculatedMessageListViewHeight() {
237 return GetMessageListView()->GetHeightForWidth(GetMessageListView()->width()); 236 return GetMessageListView()->GetHeightForWidth(GetMessageListView()->width());
238 } 237 }
239 238
240 views::BoundsAnimator* MessageCenterViewTest::GetAnimator() { 239 views::BoundsAnimator* MessageCenterViewTest::GetAnimator() {
241 return &GetMessageListView()->animator_; 240 return &GetMessageListView()->animator_;
242 } 241 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 AddNotification( 593 AddNotification(
595 std::unique_ptr<Notification>(new Notification(pinned_notification))); 594 std::unique_ptr<Notification>(new Notification(pinned_notification)));
596 595
597 // There should be 1 pinned notification. 596 // There should be 1 pinned notification.
598 EXPECT_EQ(1u, GetMessageCenter()->GetVisibleNotifications().size()); 597 EXPECT_EQ(1u, GetMessageCenter()->GetVisibleNotifications().size());
599 EXPECT_FALSE(close_button->enabled()); 598 EXPECT_FALSE(close_button->enabled());
600 #endif // defined(OS_CHROMEOS) 599 #endif // defined(OS_CHROMEOS)
601 } 600 }
602 601
603 } // namespace message_center 602 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698