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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/aura/input_state_lookup.h" | 25 #include "ui/aura/input_state_lookup.h" |
26 #include "ui/aura/test/env_test_helper.h" | 26 #include "ui/aura/test/env_test_helper.h" |
27 #include "ui/aura/test/event_generator_delegate_aura.h" | 27 #include "ui/aura/test/event_generator_delegate_aura.h" |
28 #include "ui/base/ime/input_method_initializer.h" | 28 #include "ui/base/ime/input_method_initializer.h" |
29 #include "ui/base/material_design/material_design_controller.h" | 29 #include "ui/base/material_design/material_design_controller.h" |
30 #include "ui/base/test/material_design_controller_test_api.h" | 30 #include "ui/base/test/material_design_controller_test_api.h" |
31 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 31 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
32 #include "ui/compositor/test/context_factories_for_test.h" | 32 #include "ui/compositor/test/context_factories_for_test.h" |
33 #include "ui/display/manager/managed_display_info.h" | 33 #include "ui/display/manager/managed_display_info.h" |
34 #include "ui/display/test/display_manager_test_api.h" | 34 #include "ui/display/test/display_manager_test_api.h" |
35 #include "ui/message_center/message_center.h" | |
36 #include "ui/wm/core/capture_controller.h" | 35 #include "ui/wm/core/capture_controller.h" |
37 #include "ui/wm/core/cursor_manager.h" | 36 #include "ui/wm/core/cursor_manager.h" |
38 #include "ui/wm/core/wm_state.h" | 37 #include "ui/wm/core/wm_state.h" |
39 | 38 |
40 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
41 #include "ash/system/chromeos/screen_layout_observer.h" | 40 #include "ash/system/chromeos/screen_layout_observer.h" |
42 #include "chromeos/audio/cras_audio_handler.h" | 41 #include "chromeos/audio/cras_audio_handler.h" |
43 #include "chromeos/dbus/dbus_thread_manager.h" | 42 #include "chromeos/dbus/dbus_thread_manager.h" |
44 #include "device/bluetooth/bluetooth_adapter_factory.h" | 43 #include "device/bluetooth/bluetooth_adapter_factory.h" |
45 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 44 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 ui::InitializeInputMethodForTesting(); | 83 ui::InitializeInputMethodForTesting(); |
85 | 84 |
86 bool enable_pixel_output = false; | 85 bool enable_pixel_output = false; |
87 ui::ContextFactory* context_factory = | 86 ui::ContextFactory* context_factory = |
88 ui::InitializeContextFactoryForTests(enable_pixel_output); | 87 ui::InitializeContextFactoryForTests(enable_pixel_output); |
89 | 88 |
90 // Creates Shell and hook with Desktop. | 89 // Creates Shell and hook with Desktop. |
91 if (!test_shell_delegate_) | 90 if (!test_shell_delegate_) |
92 test_shell_delegate_ = new TestShellDelegate; | 91 test_shell_delegate_ = new TestShellDelegate; |
93 | 92 |
94 // Creates MessageCenter since g_browser_process is not created in AshTestBase | |
95 // tests. | |
96 message_center::MessageCenter::Initialize(); | |
97 | |
98 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
99 // Create DBusThreadManager for testing. | 94 // Create DBusThreadManager for testing. |
100 if (!chromeos::DBusThreadManager::IsInitialized()) { | 95 if (!chromeos::DBusThreadManager::IsInitialized()) { |
101 chromeos::DBusThreadManager::Initialize( | 96 chromeos::DBusThreadManager::Initialize( |
102 chromeos::DBusThreadManager::PROCESS_ASH); | 97 chromeos::DBusThreadManager::PROCESS_ASH); |
103 dbus_thread_manager_initialized_ = true; | 98 dbus_thread_manager_initialized_ = true; |
104 } | 99 } |
105 | 100 |
106 if (!bluez::BluezDBusManager::IsInitialized()) { | 101 if (!bluez::BluezDBusManager::IsInitialized()) { |
107 bluez::BluezDBusManager::Initialize( | 102 bluez::BluezDBusManager::Initialize( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 157 |
163 void AshTestHelper::TearDown() { | 158 void AshTestHelper::TearDown() { |
164 // Tear down the shell. | 159 // Tear down the shell. |
165 Shell::DeleteInstance(); | 160 Shell::DeleteInstance(); |
166 material_design_state_.reset(); | 161 material_design_state_.reset(); |
167 test::MaterialDesignControllerTestAPI::Uninitialize(); | 162 test::MaterialDesignControllerTestAPI::Uninitialize(); |
168 ash_test_environment_->TearDown(); | 163 ash_test_environment_->TearDown(); |
169 | 164 |
170 test_screenshot_delegate_ = NULL; | 165 test_screenshot_delegate_ = NULL; |
171 | 166 |
172 // Remove global message center state. | |
173 message_center::MessageCenter::Shutdown(); | |
174 | |
175 #if defined(OS_CHROMEOS) | 167 #if defined(OS_CHROMEOS) |
176 chromeos::CrasAudioHandler::Shutdown(); | 168 chromeos::CrasAudioHandler::Shutdown(); |
177 if (bluez_dbus_manager_initialized_) { | 169 if (bluez_dbus_manager_initialized_) { |
178 device::BluetoothAdapterFactory::Shutdown(); | 170 device::BluetoothAdapterFactory::Shutdown(); |
179 bluez::BluezDBusManager::Shutdown(); | 171 bluez::BluezDBusManager::Shutdown(); |
180 bluez_dbus_manager_initialized_ = false; | 172 bluez_dbus_manager_initialized_ = false; |
181 } | 173 } |
182 if (dbus_thread_manager_initialized_) { | 174 if (dbus_thread_manager_initialized_) { |
183 chromeos::DBusThreadManager::Shutdown(); | 175 chromeos::DBusThreadManager::Shutdown(); |
184 dbus_thread_manager_initialized_ = false; | 176 dbus_thread_manager_initialized_ = false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 bool AshTestHelper::SupportsMultipleDisplays() { | 212 bool AshTestHelper::SupportsMultipleDisplays() { |
221 #if defined(OS_WIN) | 213 #if defined(OS_WIN) |
222 return false; | 214 return false; |
223 #else | 215 #else |
224 return true; | 216 return true; |
225 #endif | 217 #endif |
226 } | 218 } |
227 | 219 |
228 } // namespace test | 220 } // namespace test |
229 } // namespace ash | 221 } // namespace ash |
OLD | NEW |