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

Side by Side Diff: ui/views/window/dialog_client_view_unittest.cc

Issue 2861533003: Backfill some UI tests. (Closed)
Patch Set: fix silent merge conflict 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
« no previous file with comments | « content/test/test_render_view_host.cc ('k') | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/window/dialog_client_view.h" 5 #include "ui/views/window/dialog_client_view.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // Remove |extra_button| from the View hierarchy so that it can be replaced. 413 // Remove |extra_button| from the View hierarchy so that it can be replaced.
414 delete extra_button; 414 delete extra_button;
415 415
416 // Non-buttons should always be sized to their preferred size. 416 // Non-buttons should always be sized to their preferred size.
417 View* boring_view = new StaticSizedView(gfx::Size(20, 20)); 417 View* boring_view = new StaticSizedView(gfx::Size(20, 20));
418 SetExtraView(boring_view); 418 SetExtraView(boring_view);
419 CheckContentsIsSetToPreferredSize(); 419 CheckContentsIsSetToPreferredSize();
420 EXPECT_EQ(20, boring_view->width()); 420 EXPECT_EQ(20, boring_view->width());
421 } 421 }
422 422
423 TEST_F(DialogClientViewTest, ButtonPosition) {
424 constexpr int button_row_inset = 13;
425 client_view()->SetButtonRowInsets(gfx::Insets(button_row_inset));
426 constexpr int contents_height = 37;
427 constexpr int contents_width = 222;
428 SetSizeConstraints(gfx::Size(), gfx::Size(contents_width, contents_height),
429 gfx::Size(666, 666));
430 SetDialogButtons(ui::DIALOG_BUTTON_OK);
431 client_view()->SizeToPreferredSize();
432 client_view()->Layout();
433 EXPECT_EQ(contents_width - button_row_inset,
434 client_view()->ok_button()->bounds().right());
435 EXPECT_EQ(contents_height + button_row_inset,
436 height() + client_view()->ok_button()->y());
437 }
438
423 } // namespace views 439 } // namespace views
OLDNEW
« no previous file with comments | « content/test/test_render_view_host.cc ('k') | ui/views/window/dialog_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698