| 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 f4f72eeffa56ca5d30dc541e6d2796d7ffdcdf65..f34c1f23b36731a8ca9b8f45ebeb42b949d33cb2 100644
|
| --- a/ui/views/window/dialog_client_view_unittest.cc
|
| +++ b/ui/views/window/dialog_client_view_unittest.cc
|
| @@ -49,14 +49,16 @@ class DialogClientViewTest : public ViewsTestBase,
|
| // testing::Test implementation.
|
| void SetUp() override {
|
| dialog_buttons_ = ui::DIALOG_BUTTON_NONE;
|
| - contents_.reset(new StaticSizedView(gfx::Size(100, 200)));
|
| - client_view_.reset(new TestDialogClientView(contents_.get(), this));
|
| -
|
| + contents_ = new StaticSizedView(gfx::Size(100, 200));
|
| + client_view_.reset(new TestDialogClientView(contents_, this));
|
| + // Add |contents_| as a child of |client_view|. This is generally done when
|
| + // the client view is added to the view hierarchy.
|
| + client_view_->AddChildViewAt(contents_, 0);
|
| ViewsTestBase::SetUp();
|
| }
|
|
|
| // DialogDelegateView implementation.
|
| - View* GetContentsView() override { return contents_.get(); }
|
| + View* GetContentsView() override { return contents_; }
|
| View* CreateExtraView() override { return extra_view_; }
|
| bool GetExtraViewPadding(int* padding) override {
|
| if (extra_view_padding_)
|
| @@ -107,7 +109,7 @@ class DialogClientViewTest : public ViewsTestBase,
|
|
|
| private:
|
| // The contents of the dialog.
|
| - scoped_ptr<View> contents_;
|
| + View* contents_;
|
| // The DialogClientView that's being tested.
|
| scoped_ptr<TestDialogClientView> client_view_;
|
| // The bitmask of buttons to show in the dialog.
|
| @@ -166,7 +168,7 @@ TEST_F(DialogClientViewTest, RemoveAndUpdateButtons) {
|
| }
|
|
|
| // Test that views inside the dialog client view have the correct focus order.
|
| -TEST_F(DialogClientViewTest, SetupFocusChain) {
|
| +TEST_F(DialogClientViewTest, FocusOrder) {
|
| #if defined(OS_WIN) || defined(OS_CHROMEOS)
|
| const bool kIsOkButtonOnLeftSide = true;
|
| #else
|
| @@ -202,6 +204,11 @@ TEST_F(DialogClientViewTest, SetupFocusChain) {
|
| client_view()->GetContentsView()->GetNextFocusableView());
|
| EXPECT_EQ(client_view()->cancel_button(), extra_view->GetNextFocusableView());
|
| EXPECT_EQ(nullptr, client_view()->cancel_button()->GetNextFocusableView());
|
| +
|
| + // Add a dummy view to the client view.
|
| + View* dummy_view = new StaticSizedView(gfx::Size(200, 200));
|
| + client_view()->AddChildView(dummy_view);
|
| + EXPECT_EQ(dummy_view, client_view()->cancel_button()->GetNextFocusableView());
|
| }
|
|
|
| // Test that the contents view gets its preferred size in the basic dialog
|
|
|