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

Unified Diff: ui/views/bubble/bubble_frame_view_unittest.cc

Issue 2860953002: Harmony: Apply the upper bound on equal-sized button widths in DialogClientView. (Closed)
Patch Set: test_layout_provider.h, sanity checks, self-review: nit data member names 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/layout/layout_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view_unittest.cc
diff --git a/ui/views/bubble/bubble_frame_view_unittest.cc b/ui/views/bubble/bubble_frame_view_unittest.cc
index 705e17744288dfde2b1d9c7989577266a0c4e3ee..536d2e323b9a8ac5c6d0e6443d21810e1bd6bbe3 100644
--- a/ui/views/bubble/bubble_frame_view_unittest.cc
+++ b/ui/views/bubble/bubble_frame_view_unittest.cc
@@ -14,6 +14,7 @@
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/test/test_layout_provider.h"
#include "ui/views/test/test_views.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
@@ -516,30 +517,12 @@ class TestBubbleDialogDelegateView : public BubbleDialogDelegateView {
DISALLOW_COPY_AND_ASSIGN(TestBubbleDialogDelegateView);
};
-class TestLayoutProvider : public LayoutProvider {
- public:
- TestLayoutProvider() : LayoutProvider() {}
- ~TestLayoutProvider() override {}
-
- // LayoutProvider:
- int GetSnappedDialogWidth(int min_width) const override {
- return snap_to_ ? snap_to_ : min_width;
- }
-
- void set_snap_to(int width) { snap_to_ = width; }
-
- private:
- int snap_to_ = 0;
-
- DISALLOW_COPY_AND_ASSIGN(TestLayoutProvider);
-};
-
} // namespace
// This test ensures that if the installed LayoutProvider snaps dialog widths,
// BubbleFrameView correctly sizes itself to that width.
TEST_F(BubbleFrameViewTest, WidthSnaps) {
- TestLayoutProvider provider;
+ test::TestLayoutProvider provider;
TestBubbleDialogDelegateView delegate;
Widget anchor;
@@ -558,7 +541,7 @@ TEST_F(BubbleFrameViewTest, WidthSnaps) {
w0->CloseNow();
constexpr int kTestWidth = 300;
- provider.set_snap_to(kTestWidth);
+ provider.SetSnappedDialogWidth(kTestWidth);
// The Widget's snapped width should exactly match the width returned by the
// LayoutProvider.
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/layout/layout_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698