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

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

Issue 2625083003: Implement Harmony-style consistent button widths for Collected Cookies. (Closed)
Patch Set: Start on DialogClientview Created 3 years, 10 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/window/dialog_client_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e1f28b4dc35bf06d7129836c5d004f2e59000ffb..f7747f9b1c0718a97c23270925d5164bbe2e9fbf 100644
--- a/ui/views/window/dialog_client_view_unittest.cc
+++ b/ui/views/window/dialog_client_view_unittest.cc
@@ -15,12 +15,16 @@
#include "ui/views/window/dialog_delegate.h"
namespace views {
+namespace test {
class TestDialogClientView : public DialogClientView {
public:
explicit TestDialogClientView(DialogDelegateView* dialog_delegate_view)
- : DialogClientView(dialog_delegate_view),
- dialog_delegate_view_(dialog_delegate_view) {}
+ : DialogClientView(nullptr, dialog_delegate_view),
+ dialog_delegate_view_(dialog_delegate_view) {
+ // Clear button insets from the ViewsDelegate.
+ button_row_insets_ = gfx::Insets();
+ }
~TestDialogClientView() override {}
// DialogClientView implementation.
@@ -30,16 +34,16 @@ class TestDialogClientView : public DialogClientView {
View* GetContentsView() { return contents_view(); }
- void CreateExtraViews() {
- CreateExtraView();
- }
-
private:
DialogDelegateView* dialog_delegate_view_;
DISALLOW_COPY_AND_ASSIGN(TestDialogClientView);
};
+} // namespace test
+
+using test::TestDialogClientView;
+
// Base class for tests. Also acts as the dialog delegate and contents view for
// TestDialogClientView.
class DialogClientViewTest : public ViewsTestBase,
@@ -52,12 +56,12 @@ class DialogClientViewTest : public ViewsTestBase,
// testing::Test implementation.
void SetUp() override {
+ ViewsTestBase::SetUp();
dialog_buttons_ = ui::DIALOG_BUTTON_NONE;
client_view_.reset(new TestDialogClientView(this));
// Add this i.e. the contents view as a child of |client_view_|. This is
// generally done when the client view is added to the view hierarchy.
client_view_->AddChildViewAt(this, 0);
- ViewsTestBase::SetUp();
}
// DialogDelegateView implementation.
@@ -97,7 +101,6 @@ class DialogClientViewTest : public ViewsTestBase,
void SetExtraView(View* view) {
DCHECK(!extra_view_);
extra_view_ = view;
- client_view_->CreateExtraViews();
}
// Sets the extra view padding.
@@ -230,6 +233,7 @@ TEST_F(DialogClientViewTest, LayoutWithButtons) {
View* extra_view = new StaticSizedView(gfx::Size(200, 200));
SetExtraView(extra_view);
+ client_view()->UpdateDialogButtons();
CheckContentsIsSetToPreferredSize();
EXPECT_GT(client_view()->bounds().height(), no_extra_view_size.height());
int width_of_dialog = client_view()->bounds().width();
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698