| 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_new_window_client.h" | 10 #include "ash/common/test/test_new_window_client.h" |
| 11 #include "ash/common/test/test_session_state_delegate.h" | 11 #include "ash/common/test/test_session_state_delegate.h" |
| 12 #include "ash/common/test/test_system_tray_delegate.h" | 12 #include "ash/common/test/test_system_tray_delegate.h" |
| 13 #include "ash/common/test/wm_shell_test_api.h" | 13 #include "ash/common/test/wm_shell_test_api.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/common/wm_shell.h" |
| 15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
| 16 #include "ash/shell_init_params.h" | 16 #include "ash/shell_init_params.h" |
| 17 #include "ash/test/ash_test_environment.h" | 17 #include "ash/test/ash_test_environment.h" |
| 18 #include "ash/test/ash_test_views_delegate.h" | 18 #include "ash/test/ash_test_views_delegate.h" |
| 19 #include "ash/test/display_manager_test_api.h" | 19 #include "ash/test/display_manager_test_api.h" |
| 20 #include "ash/test/shell_test_api.h" | 20 #include "ash/test/shell_test_api.h" |
| 21 #include "ash/test/test_screenshot_delegate.h" | 21 #include "ash/test/test_screenshot_delegate.h" |
| 22 #include "ash/test/test_shell_delegate.h" | 22 #include "ash/test/test_shell_delegate.h" |
| 23 #include "base/memory/ptr_util.h" |
| 23 #include "base/run_loop.h" | 24 #include "base/run_loop.h" |
| 24 #include "ui/aura/env.h" | 25 #include "ui/aura/env.h" |
| 25 #include "ui/aura/input_state_lookup.h" | 26 #include "ui/aura/input_state_lookup.h" |
| 26 #include "ui/aura/test/env_test_helper.h" | 27 #include "ui/aura/test/env_test_helper.h" |
| 27 #include "ui/aura/test/event_generator_delegate_aura.h" | 28 #include "ui/aura/test/event_generator_delegate_aura.h" |
| 28 #include "ui/base/ime/input_method_initializer.h" | 29 #include "ui/base/ime/input_method_initializer.h" |
| 29 #include "ui/base/material_design/material_design_controller.h" | 30 #include "ui/base/material_design/material_design_controller.h" |
| 30 #include "ui/base/test/material_design_controller_test_api.h" | 31 #include "ui/base/test/material_design_controller_test_api.h" |
| 31 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 32 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 32 #include "ui/compositor/test/context_factories_for_test.h" | 33 #include "ui/compositor/test/context_factories_for_test.h" |
| 33 #include "ui/display/manager/managed_display_info.h" | 34 #include "ui/display/manager/managed_display_info.h" |
| 34 #include "ui/message_center/message_center.h" | 35 #include "ui/message_center/message_center.h" |
| 35 #include "ui/wm/core/capture_controller.h" | 36 #include "ui/wm/core/capture_controller.h" |
| 36 #include "ui/wm/core/cursor_manager.h" | 37 #include "ui/wm/core/cursor_manager.h" |
| 38 #include "ui/wm/core/wm_state.h" |
| 37 | 39 |
| 38 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 39 #include "ash/system/chromeos/screen_layout_observer.h" | 41 #include "ash/system/chromeos/screen_layout_observer.h" |
| 40 #include "chromeos/audio/cras_audio_handler.h" | 42 #include "chromeos/audio/cras_audio_handler.h" |
| 41 #include "chromeos/dbus/dbus_thread_manager.h" | 43 #include "chromeos/dbus/dbus_thread_manager.h" |
| 42 #include "device/bluetooth/bluetooth_adapter_factory.h" | 44 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 43 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 45 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
| 44 #endif | 46 #endif |
| 45 | 47 |
| 46 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 aura::test::SetUseOverrideRedirectWindowByDefault(true); | 68 aura::test::SetUseOverrideRedirectWindowByDefault(true); |
| 67 #endif | 69 #endif |
| 68 aura::test::InitializeAuraEventGeneratorDelegate(); | 70 aura::test::InitializeAuraEventGeneratorDelegate(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 AshTestHelper::~AshTestHelper() {} | 73 AshTestHelper::~AshTestHelper() {} |
| 72 | 74 |
| 73 void AshTestHelper::SetUp(bool start_session, | 75 void AshTestHelper::SetUp(bool start_session, |
| 74 MaterialDesignController::Mode material_mode) { | 76 MaterialDesignController::Mode material_mode) { |
| 75 display::ResetDisplayIdForTest(); | 77 display::ResetDisplayIdForTest(); |
| 78 wm_state_ = base::MakeUnique<::wm::WMState>(); |
| 76 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); | 79 views_delegate_ = ash_test_environment_->CreateViewsDelegate(); |
| 77 | 80 |
| 78 // Disable animations during tests. | 81 // Disable animations during tests. |
| 79 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 82 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
| 80 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 83 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 81 ui::InitializeInputMethodForTesting(); | 84 ui::InitializeInputMethodForTesting(); |
| 82 | 85 |
| 83 bool enable_pixel_output = false; | 86 bool enable_pixel_output = false; |
| 84 ui::ContextFactory* context_factory = | 87 ui::ContextFactory* context_factory = |
| 85 ui::InitializeContextFactoryForTests(enable_pixel_output); | 88 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 bool AshTestHelper::SupportsMultipleDisplays() { | 221 bool AshTestHelper::SupportsMultipleDisplays() { |
| 219 #if defined(OS_WIN) | 222 #if defined(OS_WIN) |
| 220 return false; | 223 return false; |
| 221 #else | 224 #else |
| 222 return true; | 225 return true; |
| 223 #endif | 226 #endif |
| 224 } | 227 } |
| 225 | 228 |
| 226 } // namespace test | 229 } // namespace test |
| 227 } // namespace ash | 230 } // namespace ash |
| OLD | NEW |