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

Unified Diff: ui/views/window/dialog_client_view_unittest.cc

Issue 2861533003: Backfill some UI tests. (Closed)
Patch Set: comments 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
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

Powered by Google App Engine
This is Rietveld 408576698