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/display/extended_mouse_warp_controller.h" | 10 #include "ash/display/extended_mouse_warp_controller.h" |
11 #include "ash/display/mouse_cursor_event_filter.h" | 11 #include "ash/display/mouse_cursor_event_filter.h" |
12 #include "ash/display/unified_mouse_warp_controller.h" | 12 #include "ash/display/unified_mouse_warp_controller.h" |
13 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 14 #include "ash/ime/input_method_event_handler.h" |
14 #include "ash/mus/top_level_window_factory.h" | 15 #include "ash/mus/top_level_window_factory.h" |
15 #include "ash/mus/window_manager.h" | 16 #include "ash/mus/window_manager.h" |
16 #include "ash/mus/window_manager_application.h" | 17 #include "ash/mus/window_manager_application.h" |
17 #include "ash/public/cpp/config.h" | 18 #include "ash/public/cpp/config.h" |
18 #include "ash/public/cpp/window_properties.h" | 19 #include "ash/public/cpp/window_properties.h" |
19 #include "ash/root_window_controller.h" | 20 #include "ash/root_window_controller.h" |
20 #include "ash/session/session_controller.h" | 21 #include "ash/session/session_controller.h" |
21 #include "ash/shell.h" | 22 #include "ash/shell.h" |
22 #include "ash/shell/toplevel_window.h" | 23 #include "ash/shell/toplevel_window.h" |
23 #include "ash/shell_port.h" | 24 #include "ash/shell_port.h" |
24 #include "ash/test/ash_test_environment.h" | 25 #include "ash/test/ash_test_environment.h" |
25 #include "ash/test/ash_test_helper.h" | 26 #include "ash/test/ash_test_helper.h" |
26 #include "ash/test/test_session_controller_client.h" | 27 #include "ash/test/test_session_controller_client.h" |
27 #include "ash/test/test_shell_delegate.h" | 28 #include "ash/test/test_shell_delegate.h" |
28 #include "ash/test/test_system_tray_delegate.h" | 29 #include "ash/test/test_system_tray_delegate.h" |
29 #include "ash/wm/window_positioner.h" | 30 #include "ash/wm/window_positioner.h" |
30 #include "ash/wm_window.h" | 31 #include "ash/wm_window.h" |
31 #include "services/ui/public/cpp/property_type_converters.h" | 32 #include "services/ui/public/cpp/property_type_converters.h" |
32 #include "services/ui/public/interfaces/window_manager.mojom.h" | 33 #include "services/ui/public/interfaces/window_manager.mojom.h" |
33 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 34 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
34 #include "ui/aura/client/aura_constants.h" | 35 #include "ui/aura/client/aura_constants.h" |
35 #include "ui/aura/client/screen_position_client.h" | 36 #include "ui/aura/client/screen_position_client.h" |
36 #include "ui/aura/client/window_parenting_client.h" | 37 #include "ui/aura/client/window_parenting_client.h" |
37 #include "ui/aura/env.h" | 38 #include "ui/aura/env.h" |
38 #include "ui/aura/mus/property_converter.h" | 39 #include "ui/aura/mus/property_converter.h" |
39 #include "ui/aura/test/aura_test_utils.h" | |
40 #include "ui/aura/test/event_generator_delegate_aura.h" | 40 #include "ui/aura/test/event_generator_delegate_aura.h" |
41 #include "ui/aura/test/test_window_delegate.h" | 41 #include "ui/aura/test/test_window_delegate.h" |
42 #include "ui/aura/window.h" | 42 #include "ui/aura/window.h" |
43 #include "ui/aura/window_delegate.h" | 43 #include "ui/aura/window_delegate.h" |
44 #include "ui/aura/window_tree_host.h" | 44 #include "ui/aura/window_tree_host.h" |
45 #include "ui/base/ime/input_method_initializer.h" | 45 #include "ui/base/ime/input_method_initializer.h" |
46 #include "ui/display/display.h" | 46 #include "ui/display/display.h" |
47 #include "ui/display/screen.h" | 47 #include "ui/display/screen.h" |
48 #include "ui/display/test/display_manager_test_api.h" | 48 #include "ui/display/test/display_manager_test_api.h" |
49 #include "ui/display/types/display_constants.h" | 49 #include "ui/display/types/display_constants.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 break; | 462 break; |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 void AshTestBase::UnblockUserSession() { | 466 void AshTestBase::UnblockUserSession() { |
467 SetSessionStarted(true); | 467 SetSessionStarted(true); |
468 GetSessionControllerClient()->UnlockScreen(); | 468 GetSessionControllerClient()->UnlockScreen(); |
469 } | 469 } |
470 | 470 |
471 void AshTestBase::DisableIME() { | 471 void AshTestBase::DisableIME() { |
472 aura::test::DisableIME(Shell::GetPrimaryRootWindow()->GetHost()); | 472 // WindowTreeHostManager isn't applicable to mash and IME is routed |
| 473 // differently in mash. |
| 474 if (Shell::GetAshConfig() == Config::MASH) |
| 475 return; |
| 476 |
| 477 Shell::Get()->RemovePreTargetHandler( |
| 478 Shell::Get()->window_tree_host_manager()->input_method_event_handler()); |
473 } | 479 } |
474 | 480 |
475 display::DisplayManager* AshTestBase::display_manager() { | 481 display::DisplayManager* AshTestBase::display_manager() { |
476 return Shell::Get()->display_manager(); | 482 return Shell::Get()->display_manager(); |
477 } | 483 } |
478 | 484 |
479 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, | 485 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, |
480 const gfx::Point& point_in_screen) { | 486 const gfx::Point& point_in_screen) { |
481 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode()); | 487 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode()); |
482 static_cast<ExtendedMouseWarpController*>( | 488 static_cast<ExtendedMouseWarpController*>( |
(...skipping 21 matching lines...) Expand all Loading... |
504 return display::Screen::GetScreen()->GetDisplayNearestWindow( | 510 return display::Screen::GetScreen()->GetDisplayNearestWindow( |
505 Shell::GetPrimaryRootWindow()); | 511 Shell::GetPrimaryRootWindow()); |
506 } | 512 } |
507 | 513 |
508 display::Display AshTestBase::GetSecondaryDisplay() { | 514 display::Display AshTestBase::GetSecondaryDisplay() { |
509 return ash_test_helper_->GetSecondaryDisplay(); | 515 return ash_test_helper_->GetSecondaryDisplay(); |
510 } | 516 } |
511 | 517 |
512 } // namespace test | 518 } // namespace test |
513 } // namespace ash | 519 } // namespace ash |
OLD | NEW |