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

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

Issue 2853783004: Retrieve pinned flag directly from Notification class (Closed)
Patch Set: Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 int keyboard_event_count_ = 0; 84 int keyboard_event_count_ = 0;
85 gfx::Size preferred_size_ = gfx::Size(100, 100); 85 gfx::Size preferred_size_ = gfx::Size(100, 100);
86 86
87 DISALLOW_COPY_AND_ASSIGN(TestCustomView); 87 DISALLOW_COPY_AND_ASSIGN(TestCustomView);
88 }; 88 };
89 89
90 class TestContentViewDelegate : public CustomNotificationContentViewDelegate { 90 class TestContentViewDelegate : public CustomNotificationContentViewDelegate {
91 public: 91 public:
92 bool IsCloseButtonFocused() const override { return false; } 92 bool IsCloseButtonFocused() const override { return false; }
93 void RequestFocusOnCloseButton() override {} 93 void RequestFocusOnCloseButton() override {}
94 bool IsPinned() const override { return false; }
95 void UpdateControlButtonsVisibility() override {} 94 void UpdateControlButtonsVisibility() override {}
96 }; 95 };
97 96
98 class TestNotificationDelegate : public NotificationDelegate { 97 class TestNotificationDelegate : public NotificationDelegate {
99 public: 98 public:
100 TestNotificationDelegate() {} 99 TestNotificationDelegate() {}
101 100
102 // NotificateDelegate 101 // NotificateDelegate
103 std::unique_ptr<CustomContent> CreateCustomContent() override { 102 std::unique_ptr<CustomContent> CreateCustomContent() override {
104 return base::MakeUnique<CustomContent>( 103 return base::MakeUnique<CustomContent>(
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 EXPECT_EQ("360x10", size.ToString()); 390 EXPECT_EQ("360x10", size.ToString());
392 391
393 // The long notification. 392 // The long notification.
394 custom_view()->set_preferred_size(gfx::Size(1000, 1000)); 393 custom_view()->set_preferred_size(gfx::Size(1000, 1000));
395 size = notification_view()->GetPreferredSize(); 394 size = notification_view()->GetPreferredSize();
396 size.Enlarge(0, -notification_view()->GetInsets().height()); 395 size.Enlarge(0, -notification_view()->GetInsets().height());
397 EXPECT_EQ("360x1000", size.ToString()); 396 EXPECT_EQ("360x1000", size.ToString());
398 } 397 }
399 398
400 } // namespace message_center 399 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/custom_notification_view.cc ('k') | ui/message_center/views/message_center_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698