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/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/aura/shell_port_classic.h" | 9 #include "ash/aura/shell_port_classic.h" |
10 #include "ash/mus/bridge/shell_port_mash.h" | 10 #include "ash/mus/bridge/shell_port_mash.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ash/test/test_screenshot_delegate.h" | 22 #include "ash/test/test_screenshot_delegate.h" |
23 #include "ash/test/test_session_state_delegate.h" | 23 #include "ash/test/test_session_state_delegate.h" |
24 #include "ash/test/test_shell_delegate.h" | 24 #include "ash/test/test_shell_delegate.h" |
25 #include "ash/test/test_system_tray_delegate.h" | 25 #include "ash/test/test_system_tray_delegate.h" |
26 #include "ash/wm_window.h" | 26 #include "ash/wm_window.h" |
27 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
28 #include "base/run_loop.h" | 28 #include "base/run_loop.h" |
29 #include "base/strings/string_split.h" | 29 #include "base/strings/string_split.h" |
30 #include "base/test/sequenced_worker_pool_owner.h" | 30 #include "base/test/sequenced_worker_pool_owner.h" |
31 #include "chromeos/audio/cras_audio_handler.h" | 31 #include "chromeos/audio/cras_audio_handler.h" |
| 32 #include "chromeos/cryptohome/system_salt_getter.h" |
32 #include "chromeos/dbus/dbus_thread_manager.h" | 33 #include "chromeos/dbus/dbus_thread_manager.h" |
33 #include "chromeos/network/network_handler.h" | 34 #include "chromeos/network/network_handler.h" |
34 #include "device/bluetooth/bluetooth_adapter_factory.h" | 35 #include "device/bluetooth/bluetooth_adapter_factory.h" |
35 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 36 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
36 #include "services/ui/public/cpp/input_devices/input_device_client.h" | 37 #include "services/ui/public/cpp/input_devices/input_device_client.h" |
37 #include "ui/aura/env.h" | 38 #include "ui/aura/env.h" |
38 #include "ui/aura/input_state_lookup.h" | 39 #include "ui/aura/input_state_lookup.h" |
39 #include "ui/aura/mus/window_tree_client.h" | 40 #include "ui/aura/mus/window_tree_client.h" |
40 #include "ui/aura/test/env_test_helper.h" | 41 #include "ui/aura/test/env_test_helper.h" |
41 #include "ui/aura/test/event_generator_delegate_aura.h" | 42 #include "ui/aura/test/event_generator_delegate_aura.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 if (!bluez::BluezDBusManager::IsInitialized()) { | 144 if (!bluez::BluezDBusManager::IsInitialized()) { |
144 bluez::BluezDBusManager::Initialize( | 145 bluez::BluezDBusManager::Initialize( |
145 chromeos::DBusThreadManager::Get()->GetSystemBus(), | 146 chromeos::DBusThreadManager::Get()->GetSystemBus(), |
146 chromeos::DBusThreadManager::Get()->IsUsingFakes()); | 147 chromeos::DBusThreadManager::Get()->IsUsingFakes()); |
147 bluez_dbus_manager_initialized_ = true; | 148 bluez_dbus_manager_initialized_ = true; |
148 } | 149 } |
149 | 150 |
150 // Create CrasAudioHandler for testing since g_browser_process is not | 151 // Create CrasAudioHandler for testing since g_browser_process is not |
151 // created in AshTestBase tests. | 152 // created in AshTestBase tests. |
152 chromeos::CrasAudioHandler::InitializeForTesting(); | 153 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 154 chromeos::SystemSaltGetter::Initialize(); |
153 } | 155 } |
154 | 156 |
155 ash_test_environment_->SetUp(); | 157 ash_test_environment_->SetUp(); |
156 // Reset the global state for the cursor manager. This includes the | 158 // Reset the global state for the cursor manager. This includes the |
157 // last cursor visibility state, etc. | 159 // last cursor visibility state, etc. |
158 ::wm::CursorManager::ResetCursorVisibilityStateForTest(); | 160 ::wm::CursorManager::ResetCursorVisibilityStateForTest(); |
159 | 161 |
160 // ContentTestSuiteBase might have already initialized | 162 // ContentTestSuiteBase might have already initialized |
161 // MaterialDesignController in unit_tests suite. | 163 // MaterialDesignController in unit_tests suite. |
162 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 164 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // MojoCompositorFrameSinkClient::ReclaimResources() | 222 // MojoCompositorFrameSinkClient::ReclaimResources() |
221 RunAllPendingInMessageLoop(); | 223 RunAllPendingInMessageLoop(); |
222 ash_test_environment_->TearDown(); | 224 ash_test_environment_->TearDown(); |
223 | 225 |
224 test_screenshot_delegate_ = NULL; | 226 test_screenshot_delegate_ = NULL; |
225 | 227 |
226 if (config_ == Config::CLASSIC) { | 228 if (config_ == Config::CLASSIC) { |
227 // Remove global message center state. | 229 // Remove global message center state. |
228 message_center::MessageCenter::Shutdown(); | 230 message_center::MessageCenter::Shutdown(); |
229 | 231 |
| 232 chromeos::SystemSaltGetter::Shutdown(); |
230 chromeos::CrasAudioHandler::Shutdown(); | 233 chromeos::CrasAudioHandler::Shutdown(); |
231 } | 234 } |
232 | 235 |
233 if (bluez_dbus_manager_initialized_) { | 236 if (bluez_dbus_manager_initialized_) { |
234 device::BluetoothAdapterFactory::Shutdown(); | 237 device::BluetoothAdapterFactory::Shutdown(); |
235 bluez::BluezDBusManager::Shutdown(); | 238 bluez::BluezDBusManager::Shutdown(); |
236 bluez_dbus_manager_initialized_ = false; | 239 bluez_dbus_manager_initialized_ = false; |
237 } | 240 } |
238 | 241 |
239 if (dbus_thread_manager_initialized_) { | 242 if (dbus_thread_manager_initialized_) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 std::set<RootWindowController*> roots = | 415 std::set<RootWindowController*> roots = |
413 window_manager_app_->window_manager()->GetRootWindowControllers(); | 416 window_manager_app_->window_manager()->GetRootWindowControllers(); |
414 std::vector<RootWindowController*> ordered_roots; | 417 std::vector<RootWindowController*> ordered_roots; |
415 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); | 418 ordered_roots.insert(ordered_roots.begin(), roots.begin(), roots.end()); |
416 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); | 419 std::sort(ordered_roots.begin(), ordered_roots.end(), &CompareByDisplayId); |
417 return ordered_roots; | 420 return ordered_roots; |
418 } | 421 } |
419 | 422 |
420 } // namespace test | 423 } // namespace test |
421 } // namespace ash | 424 } // namespace ash |
OLD | NEW |