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

Unified Diff: ui/message_center/views/custom_notification_view_unittest.cc

Issue 2547433002: Transfer responsibility for providing a close button for a notification to each implementation of M… (Closed)
Patch Set: WrapUnique -> MakeUnique Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/custom_notification_view.cc ('k') | ui/message_center/views/message_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e26c4b2f8a08d42ffef7f055b2582605c2cd1dce 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::MakeUnique<TestCustomView>(),
+ base::MakeUnique<TestContentViewDelegate>());
}
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();
« no previous file with comments | « ui/message_center/views/custom_notification_view.cc ('k') | ui/message_center/views/message_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698