| 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.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/display_manager_test_api.h" | 10 #include "ash/test/display_manager_test_api.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
| 28 #include "chromeos/audio/cras_audio_handler.h" | 28 #include "chromeos/audio/cras_audio_handler.h" |
| 29 #include "chromeos/dbus/dbus_thread_manager.h" | 29 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "ui/keyboard/keyboard.h" | 30 #include "ui/keyboard/keyboard.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 #if defined(USE_X11) | 33 #if defined(USE_X11) |
| 34 #include "ui/aura/window_tree_host_x11.h" | 34 #include "ui/aura/window_tree_host_x11.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #if defined(OS_WIN) |
| 38 #include "ash/host/ash_remote_window_tree_host_win.h" |
| 39 #endif |
| 40 |
| 37 namespace ash { | 41 namespace ash { |
| 38 namespace test { | 42 namespace test { |
| 39 | 43 |
| 40 AshTestHelper::AshTestHelper(base::MessageLoopForUI* message_loop) | 44 AshTestHelper::AshTestHelper(base::MessageLoopForUI* message_loop) |
| 41 : message_loop_(message_loop), | 45 : message_loop_(message_loop), |
| 42 test_shell_delegate_(NULL), | 46 test_shell_delegate_(NULL), |
| 43 test_screenshot_delegate_(NULL), | 47 test_screenshot_delegate_(NULL), |
| 44 dbus_thread_manager_initialized_(false) { | 48 dbus_thread_manager_initialized_(false) { |
| 45 CHECK(message_loop_); | 49 CHECK(message_loop_); |
| 46 #if defined(USE_X11) | 50 #if defined(USE_X11) |
| 47 aura::test::SetUseOverrideRedirectWindowByDefault(true); | 51 aura::test::SetUseOverrideRedirectWindowByDefault(true); |
| 48 #endif | 52 #endif |
| 49 } | 53 } |
| 50 | 54 |
| 51 AshTestHelper::~AshTestHelper() { | 55 AshTestHelper::~AshTestHelper() { |
| 52 } | 56 } |
| 53 | 57 |
| 54 void AshTestHelper::SetUp(bool start_session) { | 58 void AshTestHelper::SetUp(bool start_session) { |
| 59 #if defined(OS_WIN) |
| 60 AshRemoteWindowTreeHostWin::Init(); |
| 61 #endif |
| 55 wm_state_.reset(new wm::WMState); | 62 wm_state_.reset(new wm::WMState); |
| 56 | 63 |
| 57 // Disable animations during tests. | 64 // Disable animations during tests. |
| 58 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 65 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
| 59 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 66 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 60 ui::InitializeInputMethodForTesting(); | 67 ui::InitializeInputMethodForTesting(); |
| 61 | 68 |
| 62 bool enable_pixel_output = false; | 69 bool enable_pixel_output = false; |
| 63 ui::InitializeContextFactoryForTests(enable_pixel_output); | 70 ui::InitializeContextFactoryForTests(enable_pixel_output); |
| 64 | 71 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 aura::Window* AshTestHelper::CurrentContext() { | 149 aura::Window* AshTestHelper::CurrentContext() { |
| 143 aura::Window* root_window = Shell::GetTargetRootWindow(); | 150 aura::Window* root_window = Shell::GetTargetRootWindow(); |
| 144 if (!root_window) | 151 if (!root_window) |
| 145 root_window = Shell::GetPrimaryRootWindow(); | 152 root_window = Shell::GetPrimaryRootWindow(); |
| 146 DCHECK(root_window); | 153 DCHECK(root_window); |
| 147 return root_window; | 154 return root_window; |
| 148 } | 155 } |
| 149 | 156 |
| 150 } // namespace test | 157 } // namespace test |
| 151 } // namespace ash | 158 } // namespace ash |
| OLD | NEW |