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

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

Issue 2685283002: Add UpdateNotificationSize to MessageCenterController. (Closed)
Patch Set: address comments Created 3 years, 10 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void ClickOnNotification(const std::string& notification_id) override; 149 void ClickOnNotification(const std::string& notification_id) override;
150 void RemoveNotification(const std::string& notification_id, 150 void RemoveNotification(const std::string& notification_id,
151 bool by_user) override; 151 bool by_user) override;
152 std::unique_ptr<ui::MenuModel> CreateMenuModel( 152 std::unique_ptr<ui::MenuModel> CreateMenuModel(
153 const NotifierId& notifier_id, 153 const NotifierId& notifier_id,
154 const base::string16& display_source) override; 154 const base::string16& display_source) override;
155 bool HasClickedListener(const std::string& notification_id) override; 155 bool HasClickedListener(const std::string& notification_id) override;
156 void ClickOnNotificationButton(const std::string& notification_id, 156 void ClickOnNotificationButton(const std::string& notification_id,
157 int button_index) override; 157 int button_index) override;
158 void ClickOnSettingsButton(const std::string& notification_id) override; 158 void ClickOnSettingsButton(const std::string& notification_id) override;
159 void UpdateNotificationSize(const std::string& notification_id) override;
159 160
160 // Overridden from MockNotificationView::Test 161 // Overridden from MockNotificationView::Test
161 void RegisterCall(CallType type) override; 162 void RegisterCall(CallType type) override;
162 163
163 void FireOnMouseExitedEvent(); 164 void FireOnMouseExitedEvent();
164 165
165 void LogBounds(int depth, views::View* view); 166 void LogBounds(int depth, views::View* view);
166 167
167 MessageCenterButtonBar* GetButtonBar() const; 168 MessageCenterButtonBar* GetButtonBar() const;
168 169
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 // For this test, this method should not be invoked. 347 // For this test, this method should not be invoked.
347 NOTREACHED(); 348 NOTREACHED();
348 } 349 }
349 350
350 void MessageCenterViewTest::ClickOnSettingsButton( 351 void MessageCenterViewTest::ClickOnSettingsButton(
351 const std::string& notification_id) { 352 const std::string& notification_id) {
352 // For this test, this method should not be invoked. 353 // For this test, this method should not be invoked.
353 NOTREACHED(); 354 NOTREACHED();
354 } 355 }
355 356
357 void MessageCenterViewTest::UpdateNotificationSize(
358 const std::string& notification_id) {
359 // For this test, this method should not be invoked.
360 NOTREACHED();
361 }
362
356 void MessageCenterViewTest::RegisterCall(CallType type) { 363 void MessageCenterViewTest::RegisterCall(CallType type) {
357 callCounts_[type] += 1; 364 callCounts_[type] += 1;
358 } 365 }
359 366
360 void MessageCenterViewTest::FireOnMouseExitedEvent() { 367 void MessageCenterViewTest::FireOnMouseExitedEvent() {
361 ui::MouseEvent dummy_event( 368 ui::MouseEvent dummy_event(
362 ui::ET_MOUSE_EXITED /* type */, gfx::Point(0, 0) /* location */, 369 ui::ET_MOUSE_EXITED /* type */, gfx::Point(0, 0) /* location */,
363 gfx::Point(0, 0) /* root location */, base::TimeTicks() /* time_stamp */, 370 gfx::Point(0, 0) /* root location */, base::TimeTicks() /* time_stamp */,
364 0 /* flags */, 0 /*changed_button_flags */); 371 0 /* flags */, 0 /*changed_button_flags */);
365 message_center_view_->OnMouseExited(dummy_event); 372 message_center_view_->OnMouseExited(dummy_event);
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 base::UTF8ToUTF16("title1"), base::UTF8ToUTF16("message"), gfx::Image(), 850 base::UTF8ToUTF16("title1"), base::UTF8ToUTF16("message"), gfx::Image(),
844 base::UTF8ToUTF16("display source"), GURL(), 851 base::UTF8ToUTF16("display source"), GURL(),
845 NotifierId(NotifierId::APPLICATION, "extension_id"), 852 NotifierId(NotifierId::APPLICATION, "extension_id"),
846 message_center::RichNotificationData(), nullptr)); 853 message_center::RichNotificationData(), nullptr));
847 854
848 GetMessageCenterView()->SizeToPreferredSize(); 855 GetMessageCenterView()->SizeToPreferredSize();
849 EXPECT_NE(kEmptyMessageCenterViewHeight, GetMessageCenterView()->height()); 856 EXPECT_NE(kEmptyMessageCenterViewHeight, GetMessageCenterView()->height());
850 } 857 }
851 858
852 } // namespace message_center 859 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view.cc ('k') | ui/message_center/views/message_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698