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 9e338c563d8b20b58956405fa41e23649480f43c..c8d4ebf8ca0daa789b6cc686ff18e72cfc3a9ef3 100644 |
--- a/ui/views/bubble/bubble_frame_view_unittest.cc |
+++ b/ui/views/bubble/bubble_frame_view_unittest.cc |
@@ -12,6 +12,7 @@ |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/geometry/size.h" |
#include "ui/views/bubble/bubble_border.h" |
+#include "ui/views/controls/button/image_button.h" |
#include "ui/views/test/test_views.h" |
#include "ui/views/test/views_test_base.h" |
#include "ui/views/widget/widget.h" |
@@ -36,7 +37,8 @@ const int kPreferredClientHeight = 250; |
// These account for non-client areas like the title bar, footnote etc. However |
// these do not take the bubble border into consideration. |
const int kExpectedAdditionalWidth = 12; |
-const int kExpectedAdditionalHeight = 12; |
+// 12 for the builtin margin, 14 for the close button margin |
+const int kExpectedAdditionalHeight = 12 + 14; |
class TestBubbleFrameViewWidgetDelegate : public WidgetDelegate { |
public: |
@@ -119,9 +121,11 @@ TEST_F(BubbleFrameViewTest, GetBoundsForClientView) { |
int margin_x = frame.content_margins().left(); |
int margin_y = frame.content_margins().top(); |
+ int close_y = frame.GetCloseButtonForTest()->height(); |
msw
2016/07/21 19:07:17
nit: close_height
|
gfx::Insets insets = frame.bubble_border()->GetInsets(); |
EXPECT_EQ(insets.left() + margin_x, frame.GetBoundsForClientView().x()); |
- EXPECT_EQ(insets.top() + margin_y, frame.GetBoundsForClientView().y()); |
+ EXPECT_EQ(insets.top() + margin_y + close_y, |
+ frame.GetBoundsForClientView().y()); |
} |
// Tests that the arrow is mirrored as needed to better fit the screen. |
@@ -437,6 +441,9 @@ TEST_F(BubbleFrameViewTest, GetMinimumSize) { |
// Expect that a border has been added to the minimum size. |
minimum_rect.Inset(frame.bubble_border()->GetInsets()); |
+ ImageButton* button = frame.GetCloseButtonForTest(); |
msw
2016/07/21 19:07:18
nit: inline below.
|
+ EXPECT_EQ(button->height(), 14); |
+ EXPECT_EQ(nullptr, frame.GetCloseButtonForTest()->border()); |
gfx::Size expected_size(kMinimumClientWidth + kExpectedAdditionalWidth, |
kMinimumClientHeight + kExpectedAdditionalHeight); |
EXPECT_EQ(expected_size, minimum_rect.size()); |