OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
8 #include "ash/common/material_design/material_design_controller.h" | 8 #include "ash/common/material_design/material_design_controller.h" |
9 #include "ash/common/test/material_design_controller_test_api.h" | 9 #include "ash/common/test/material_design_controller_test_api.h" |
10 #include "ash/common/test/test_session_state_delegate.h" | 10 #include "ash/common/test/test_session_state_delegate.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chromeos/audio/cras_audio_handler.h" | 24 #include "chromeos/audio/cras_audio_handler.h" |
25 #include "chromeos/dbus/dbus_thread_manager.h" | 25 #include "chromeos/dbus/dbus_thread_manager.h" |
26 #include "device/bluetooth/bluetooth_adapter_factory.h" | 26 #include "device/bluetooth/bluetooth_adapter_factory.h" |
27 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 27 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
28 #include "ui/aura/env.h" | 28 #include "ui/aura/env.h" |
29 #include "ui/aura/input_state_lookup.h" | 29 #include "ui/aura/input_state_lookup.h" |
30 #include "ui/aura/test/env_test_helper.h" | 30 #include "ui/aura/test/env_test_helper.h" |
31 #include "ui/aura/test/event_generator_delegate_aura.h" | 31 #include "ui/aura/test/event_generator_delegate_aura.h" |
32 #include "ui/base/ime/input_method_initializer.h" | 32 #include "ui/base/ime/input_method_initializer.h" |
33 #include "ui/base/material_design/material_design_controller.h" | 33 #include "ui/base/material_design/material_design_controller.h" |
| 34 #include "ui/base/platform_window_defaults.h" |
34 #include "ui/base/test/material_design_controller_test_api.h" | 35 #include "ui/base/test/material_design_controller_test_api.h" |
35 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 36 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
36 #include "ui/compositor/test/context_factories_for_test.h" | 37 #include "ui/compositor/test/context_factories_for_test.h" |
37 #include "ui/display/manager/managed_display_info.h" | 38 #include "ui/display/manager/managed_display_info.h" |
38 #include "ui/display/test/display_manager_test_api.h" | 39 #include "ui/display/test/display_manager_test_api.h" |
39 #include "ui/message_center/message_center.h" | 40 #include "ui/message_center/message_center.h" |
40 #include "ui/wm/core/capture_controller.h" | 41 #include "ui/wm/core/capture_controller.h" |
41 #include "ui/wm/core/cursor_manager.h" | 42 #include "ui/wm/core/cursor_manager.h" |
42 #include "ui/wm/core/wm_state.h" | 43 #include "ui/wm/core/wm_state.h" |
43 | 44 |
44 #if defined(USE_X11) | |
45 #include "ui/aura/window_tree_host_x11.h" | |
46 #endif | |
47 | |
48 namespace ash { | 45 namespace ash { |
49 namespace test { | 46 namespace test { |
50 | 47 |
51 AshTestHelper::AshTestHelper(AshTestEnvironment* ash_test_environment) | 48 AshTestHelper::AshTestHelper(AshTestEnvironment* ash_test_environment) |
52 : ash_test_environment_(ash_test_environment), | 49 : ash_test_environment_(ash_test_environment), |
53 test_shell_delegate_(nullptr), | 50 test_shell_delegate_(nullptr), |
54 test_screenshot_delegate_(nullptr), | 51 test_screenshot_delegate_(nullptr), |
55 dbus_thread_manager_initialized_(false), | 52 dbus_thread_manager_initialized_(false), |
56 bluez_dbus_manager_initialized_(false) { | 53 bluez_dbus_manager_initialized_(false) { |
57 #if defined(USE_X11) | 54 ui::test::EnableTestConfigForPlatformWindows(); |
58 aura::test::SetUseOverrideRedirectWindowByDefault(true); | |
59 #endif | |
60 aura::test::InitializeAuraEventGeneratorDelegate(); | 55 aura::test::InitializeAuraEventGeneratorDelegate(); |
61 } | 56 } |
62 | 57 |
63 AshTestHelper::~AshTestHelper() {} | 58 AshTestHelper::~AshTestHelper() {} |
64 | 59 |
65 void AshTestHelper::SetUp(bool start_session, | 60 void AshTestHelper::SetUp(bool start_session, |
66 MaterialDesignController::Mode material_mode) { | 61 MaterialDesignController::Mode material_mode) { |
67 display::ResetDisplayIdForTest(); | 62 display::ResetDisplayIdForTest(); |
68 wm_state_ = base::MakeUnique<::wm::WMState>(); | 63 wm_state_ = base::MakeUnique<::wm::WMState>(); |
69 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); | 64 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 aura::Window* AshTestHelper::CurrentContext() { | 196 aura::Window* AshTestHelper::CurrentContext() { |
202 aura::Window* root_window = Shell::GetTargetRootWindow(); | 197 aura::Window* root_window = Shell::GetTargetRootWindow(); |
203 if (!root_window) | 198 if (!root_window) |
204 root_window = Shell::GetPrimaryRootWindow(); | 199 root_window = Shell::GetPrimaryRootWindow(); |
205 DCHECK(root_window); | 200 DCHECK(root_window); |
206 return root_window; | 201 return root_window; |
207 } | 202 } |
208 | 203 |
209 } // namespace test | 204 } // namespace test |
210 } // namespace ash | 205 } // namespace ash |
OLD | NEW |