Chromium Code Reviews| Index: ui/message_center/views/custom_notification_view_unittest.cc |
| diff --git a/ui/message_center/views/custom_notification_view_unittest.cc b/ui/message_center/views/custom_notification_view_unittest.cc |
| index a5d87f41846290234a417daec410378db4d6526f..f948c41aea79b053bae52d3922611a57e357a6af 100644 |
| --- a/ui/message_center/views/custom_notification_view_unittest.cc |
| +++ b/ui/message_center/views/custom_notification_view_unittest.cc |
| @@ -66,13 +66,22 @@ class TestCustomView : public views::View { |
| DISALLOW_COPY_AND_ASSIGN(TestCustomView); |
| }; |
| +class TestContentViewDelegate : public CustomNotificationContentViewDelegate { |
| + public: |
| + bool IsCloseButtonFocused() const override { return false; } |
| + void RequestFocusOnCloseButton() override {} |
| + bool IsPinned() const override { return false; } |
| +}; |
| + |
| class TestNotificationDelegate : public NotificationDelegate { |
| public: |
| TestNotificationDelegate() {} |
| // NotificateDelegate |
| - std::unique_ptr<views::View> CreateCustomContent() override { |
| - return base::WrapUnique(new TestCustomView); |
| + std::unique_ptr<CustomContent> CreateCustomContent() override { |
| + return base::MakeUnique<CustomContent>( |
| + base::WrapUnique(new TestCustomView), |
| + base::WrapUnique(new TestContentViewDelegate)); |
|
xiyuan
2016/12/06 17:11:16
nit: WrapUnique -> MakeUnique
yhanada
2016/12/07 00:23:24
Done.
|
| } |
| private: |
| @@ -187,9 +196,6 @@ class CustomNotificationViewTest : public views::ViewsTestBase { |
| widget()->OnKeyEvent(&event); |
| } |
| - views::ImageButton* close_button() { |
| - return notification_view_->close_button(); |
| - } |
| TestMessageCenterController* controller() { return &controller_; } |
| Notification* notification() { return notification_.get(); } |
| TestCustomView* custom_view() { |
| @@ -210,15 +216,6 @@ TEST_F(CustomNotificationViewTest, Background) { |
| EXPECT_EQ(kBackgroundColor, GetBackgroundColor()); |
| } |
| -TEST_F(CustomNotificationViewTest, ClickCloseButton) { |
| - widget()->Show(); |
| - |
| - gfx::Point cursor_location(1, 1); |
| - views::View::ConvertPointToWidget(close_button(), &cursor_location); |
| - PerformClick(cursor_location); |
| - EXPECT_TRUE(controller()->IsRemoved(notification()->id())); |
| -} |
| - |
| TEST_F(CustomNotificationViewTest, Events) { |
| widget()->Show(); |
| custom_view()->RequestFocus(); |