Index: ui/views/window/dialog_client_view_unittest.cc |
diff --git a/ui/views/window/dialog_client_view_unittest.cc b/ui/views/window/dialog_client_view_unittest.cc |
index a8d3d8d79c222a876312009c96f65ee9328bfbb9..9fc4c61866f16bc7c43a8bb7b72a2acc54677456 100644 |
--- a/ui/views/window/dialog_client_view_unittest.cc |
+++ b/ui/views/window/dialog_client_view_unittest.cc |
@@ -405,4 +405,24 @@ TEST_F(DialogClientViewTest, LinkedWidths) { |
EXPECT_EQ(20, boring_view->width()); |
} |
+TEST_F(DialogClientViewTest, ButtonPosition) { |
+ ui::test::MaterialDesignControllerTestAPI md_test_api( |
+ ui::MaterialDesignController::MATERIAL_NORMAL); |
+ md_test_api.SetSecondaryUiMaterial(true); |
+ |
+ constexpr int button_row_inset = 13; |
+ client_view()->set_button_row_insets(gfx::Insets(button_row_inset)); |
+ constexpr int contents_height = 37; |
+ constexpr int contents_width = 222; |
+ SetSizeConstraints(gfx::Size(), gfx::Size(contents_width, contents_height), |
+ gfx::Size(666, 666)); |
+ SetDialogButtons(ui::DIALOG_BUTTON_OK); |
+ client_view()->SizeToPreferredSize(); |
+ client_view()->Layout(); |
+ EXPECT_EQ(contents_width - button_row_inset, |
+ client_view()->ok_button()->bounds().right()); |
+ EXPECT_EQ(contents_height + button_row_inset, |
+ height() + client_view()->ok_button()->y()); |
+} |
+ |
} // namespace views |