| Index: ash/wm/window_positioner_unittest.cc
|
| diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc
|
| index 325022411b10e08ff6667ecd75cd020ca1d1d842..3538962e4bbb4b77cb1c7b02c9cff4182ede55cc 100644
|
| --- a/ash/wm/window_positioner_unittest.cc
|
| +++ b/ash/wm/window_positioner_unittest.cc
|
| @@ -7,16 +7,17 @@
|
| #include <string>
|
|
|
| #include "ash/common/material_design/material_design_controller.h"
|
| +#include "ash/common/scoped_root_window_for_new_windows.h"
|
| #include "ash/common/wm/window_positioner.h"
|
| #include "ash/common/wm/window_state.h"
|
| #include "ash/common/wm_shell.h"
|
| +#include "ash/common/wm_window.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell/toplevel_window.h"
|
| #include "ash/test/ash_md_test_base.h"
|
| #include "ash/test/test_shell_delegate.h"
|
| #include "ash/wm/window_state_aura.h"
|
| #include "base/strings/string_number_conversions.h"
|
| -#include "ui/aura/window_event_dispatcher.h"
|
| #include "ui/display/screen.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/widget/widget_delegate.h"
|
| @@ -39,7 +40,8 @@ TEST_P(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
|
| // Tests that for a screen that is narrower than kForceMaximizeWidthLimit
|
| // a new window gets maximized.
|
| UpdateDisplay("400x400,500x500");
|
| - Shell::GetInstance()->set_target_root_window(Shell::GetAllRootWindows()[1]);
|
| + ScopedRootWindowForNewWindows root_for_new_windows(
|
| + WmShell::Get()->GetAllRootWindows()[1]);
|
| shell::ToplevelWindow::CreateParams params;
|
| params.can_resize = true;
|
| params.can_maximize = true;
|
| @@ -55,8 +57,8 @@ TEST_P(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
|
| ash::WindowPositioner::SetMaximizeFirstWindow(true);
|
| #endif
|
| UpdateDisplay("400x400,1400x900");
|
| - aura::Window* second_root_window = Shell::GetAllRootWindows()[1];
|
| - Shell::GetInstance()->set_target_root_window(second_root_window);
|
| + WmWindow* second_root_window = WmShell::Get()->GetAllRootWindows()[1];
|
| + ScopedRootWindowForNewWindows root_for_new_windows(second_root_window);
|
| shell::ToplevelWindow::CreateParams params;
|
| params.can_resize = true;
|
| params.can_maximize = true;
|
| @@ -68,10 +70,9 @@ TEST_P(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
|
| // The window should be in the 2nd display with the default size.
|
| EXPECT_EQ("300x300", bounds.size().ToString());
|
| #endif
|
| - EXPECT_TRUE(display::Screen::GetScreen()
|
| - ->GetDisplayNearestWindow(second_root_window)
|
| - .bounds()
|
| - .Contains(bounds));
|
| +
|
| + EXPECT_TRUE(
|
| + second_root_window->GetDisplayNearestWindow().bounds().Contains(bounds));
|
| }
|
|
|
| // Tests that second window inherits first window's maximized state as well as
|
|
|