| OLD | NEW |
| 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 "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/test/test_session_state_delegate.h" | 10 #include "ash/common/test/test_session_state_delegate.h" |
| 11 #include "ash/common/test/test_system_tray_delegate.h" | 11 #include "ash/common/test/test_system_tray_delegate.h" |
| 12 #include "ash/common/wm/window_positioner.h" | 12 #include "ash/common/wm/window_positioner.h" |
| 13 #include "ash/common/wm_root_window_controller.h" | 13 #include "ash/common/wm_root_window_controller.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/common/wm_window.h" | 15 #include "ash/common/wm_window.h" |
| 16 #include "ash/display/extended_mouse_warp_controller.h" | 16 #include "ash/display/extended_mouse_warp_controller.h" |
| 17 #include "ash/display/mouse_cursor_event_filter.h" | 17 #include "ash/display/mouse_cursor_event_filter.h" |
| 18 #include "ash/display/unified_mouse_warp_controller.h" | 18 #include "ash/display/unified_mouse_warp_controller.h" |
| 19 #include "ash/display/window_tree_host_manager.h" | 19 #include "ash/display/window_tree_host_manager.h" |
| 20 #include "ash/ime/input_method_event_handler.h" | 20 #include "ash/ime/input_method_event_handler.h" |
| 21 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 22 #include "ash/shell/toplevel_window.h" | 22 #include "ash/shell/toplevel_window.h" |
| 23 #include "ash/test/ash_test_environment.h" | 23 #include "ash/test/ash_test_environment.h" |
| 24 #include "ash/test/ash_test_helper.h" | 24 #include "ash/test/ash_test_helper.h" |
| 25 #include "ash/test/display_manager_test_api.h" | |
| 26 #include "ash/test/test_shell_delegate.h" | 25 #include "ash/test/test_shell_delegate.h" |
| 27 #include "base/command_line.h" | 26 #include "base/command_line.h" |
| 28 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
| 29 #include "ui/aura/client/screen_position_client.h" | 28 #include "ui/aura/client/screen_position_client.h" |
| 30 #include "ui/aura/client/window_parenting_client.h" | 29 #include "ui/aura/client/window_parenting_client.h" |
| 31 #include "ui/aura/env.h" | 30 #include "ui/aura/env.h" |
| 32 #include "ui/aura/test/event_generator_delegate_aura.h" | 31 #include "ui/aura/test/event_generator_delegate_aura.h" |
| 33 #include "ui/aura/test/test_window_delegate.h" | 32 #include "ui/aura/test/test_window_delegate.h" |
| 34 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 35 #include "ui/aura/window_delegate.h" | 34 #include "ui/aura/window_delegate.h" |
| 36 #include "ui/aura/window_tree_host.h" | 35 #include "ui/aura/window_tree_host.h" |
| 37 #include "ui/base/ime/input_method_initializer.h" | 36 #include "ui/base/ime/input_method_initializer.h" |
| 38 #include "ui/display/display.h" | 37 #include "ui/display/display.h" |
| 39 #include "ui/display/display_switches.h" | 38 #include "ui/display/display_switches.h" |
| 40 #include "ui/display/screen.h" | 39 #include "ui/display/screen.h" |
| 40 #include "ui/display/test/display_manager_test_api.h" |
| 41 #include "ui/events/gesture_detection/gesture_configuration.h" | 41 #include "ui/events/gesture_detection/gesture_configuration.h" |
| 42 #include "ui/gfx/geometry/point.h" | 42 #include "ui/gfx/geometry/point.h" |
| 43 #include "ui/wm/core/coordinate_conversion.h" | 43 #include "ui/wm/core/coordinate_conversion.h" |
| 44 | 44 |
| 45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
| 46 #include "base/win/windows_version.h" | 46 #include "base/win/windows_version.h" |
| 47 #include "ui/platform_window/win/win_window.h" | 47 #include "ui/platform_window/win/win_window.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 #if defined(USE_X11) | 50 #if defined(USE_X11) |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 return GetActiveDisplayRotation(display::Display::InternalDisplayId()); | 206 return GetActiveDisplayRotation(display::Display::InternalDisplayId()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // static | 209 // static |
| 210 bool AshTestBase::SupportsMultipleDisplays() { | 210 bool AshTestBase::SupportsMultipleDisplays() { |
| 211 return AshTestHelper::SupportsMultipleDisplays(); | 211 return AshTestHelper::SupportsMultipleDisplays(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // static | 214 // static |
| 215 void AshTestBase::UpdateDisplay(const std::string& display_specs) { | 215 void AshTestBase::UpdateDisplay(const std::string& display_specs) { |
| 216 DisplayManagerTestApi(Shell::GetInstance()->display_manager()) | 216 display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager()) |
| 217 .UpdateDisplay(display_specs); | 217 .UpdateDisplay(display_specs); |
| 218 } | 218 } |
| 219 | 219 |
| 220 aura::Window* AshTestBase::CurrentContext() { | 220 aura::Window* AshTestBase::CurrentContext() { |
| 221 return ash_test_helper_->CurrentContext(); | 221 return ash_test_helper_->CurrentContext(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // static | 224 // static |
| 225 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( | 225 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( |
| 226 views::WidgetDelegate* delegate, | 226 views::WidgetDelegate* delegate, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 SetUserAddingScreenRunning(false); | 365 SetUserAddingScreenRunning(false); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void AshTestBase::DisableIME() { | 368 void AshTestBase::DisableIME() { |
| 369 Shell::GetInstance()->RemovePreTargetHandler( | 369 Shell::GetInstance()->RemovePreTargetHandler( |
| 370 Shell::GetInstance() | 370 Shell::GetInstance() |
| 371 ->window_tree_host_manager() | 371 ->window_tree_host_manager() |
| 372 ->input_method_event_handler()); | 372 ->input_method_event_handler()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 DisplayManager* AshTestBase::display_manager() { | 375 display::DisplayManager* AshTestBase::display_manager() { |
| 376 return Shell::GetInstance()->display_manager(); | 376 return Shell::GetInstance()->display_manager(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, | 379 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, |
| 380 const gfx::Point& point_in_screen) { | 380 const gfx::Point& point_in_screen) { |
| 381 DCHECK(!Shell::GetInstance()->display_manager()->IsInUnifiedMode()); | 381 DCHECK(!Shell::GetInstance()->display_manager()->IsInUnifiedMode()); |
| 382 static_cast<ExtendedMouseWarpController*>( | 382 static_cast<ExtendedMouseWarpController*>( |
| 383 Shell::GetInstance() | 383 Shell::GetInstance() |
| 384 ->mouse_cursor_filter() | 384 ->mouse_cursor_filter() |
| 385 ->mouse_warp_controller_for_test()) | 385 ->mouse_warp_controller_for_test()) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 397 | 397 |
| 398 void AshTestBase::SwapPrimaryDisplay() { | 398 void AshTestBase::SwapPrimaryDisplay() { |
| 399 if (display::Screen::GetScreen()->GetNumDisplays() <= 1) | 399 if (display::Screen::GetScreen()->GetNumDisplays() <= 1) |
| 400 return; | 400 return; |
| 401 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( | 401 Shell::GetInstance()->window_tree_host_manager()->SetPrimaryDisplayId( |
| 402 display_manager()->GetSecondaryDisplay().id()); | 402 display_manager()->GetSecondaryDisplay().id()); |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace test | 405 } // namespace test |
| 406 } // namespace ash | 406 } // namespace ash |
| OLD | NEW |