| Index: ash/test/ash_test_base.cc
|
| diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
|
| index c3dde233aae96220911d463116d46a773d7e2588..3da727ac4ffd77821867c1dc5b56ce714eaf9f05 100644
|
| --- a/ash/test/ash_test_base.cc
|
| +++ b/ash/test/ash_test_base.cc
|
| @@ -63,9 +63,9 @@ class AshEventGeneratorDelegate
|
| const gfx::Point& point_in_screen) const override {
|
| display::Screen* screen = display::Screen::GetScreen();
|
| display::Display display = screen->GetDisplayNearestPoint(point_in_screen);
|
| - return Shell::GetInstance()
|
| - ->window_tree_host_manager()
|
| + return WmShell::Get()
|
| ->GetRootWindowForDisplayId(display.id())
|
| + ->aura_window()
|
| ->GetHost();
|
| }
|
|
|
| @@ -134,7 +134,9 @@ void AshTestBase::SetUp() {
|
| // Move the mouse cursor to far away so that native events doesn't
|
| // interfere test expectations.
|
| Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
|
| - Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
|
| + // TODO: mash needs to support CursorManager. http://crbug.com/637853.
|
| + if (!WmShell::Get()->IsRunningInMash())
|
| + Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
|
|
|
| // Changing GestureConfiguration shouldn't make tests fail. These values
|
| // prevent unexpected events from being generated during tests. Such as
|
| @@ -196,8 +198,13 @@ display::Display::Rotation AshTestBase::GetCurrentInternalDisplayRotation() {
|
|
|
| // static
|
| void AshTestBase::UpdateDisplay(const std::string& display_specs) {
|
| - display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
|
| - .UpdateDisplay(display_specs);
|
| + if (WmShell::Get()->IsRunningInMash()) {
|
| + ash_test_helper_->UpdateDisplayForMash(display_specs);
|
| + } else {
|
| + display::test::DisplayManagerTestApi(
|
| + Shell::GetInstance()->display_manager())
|
| + .UpdateDisplay(display_specs);
|
| + }
|
| }
|
|
|
| aura::Window* AshTestBase::CurrentContext() {
|
| @@ -264,9 +271,8 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
|
| } else {
|
| display::Display display =
|
| display::Screen::GetScreen()->GetDisplayMatching(bounds);
|
| - aura::Window* root = Shell::GetInstance()
|
| - ->window_tree_host_manager()
|
| - ->GetRootWindowForDisplayId(display.id());
|
| + aura::Window* root =
|
| + WmShell::Get()->GetRootWindowForDisplayId(display.id())->aura_window();
|
| gfx::Point origin = bounds.origin();
|
| ::wm::ConvertPointFromScreen(root, &origin);
|
| window->SetBounds(gfx::Rect(origin, bounds.size()));
|
| @@ -388,5 +394,9 @@ void AshTestBase::SwapPrimaryDisplay() {
|
| display_manager()->GetSecondaryDisplay().id());
|
| }
|
|
|
| +display::Display AshTestBase::GetSecondaryDisplay() {
|
| + return ash_test_helper_->GetSecondaryDisplay();
|
| +}
|
| +
|
| } // namespace test
|
| } // namespace ash
|
|
|