Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(879)

Side by Side Diff: ash/test/ash_test_helper.cc

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/display/display_info.h" 9 #include "ash/display/display_info.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 13 matching lines...) Expand all
24 #include "ui/aura/test/event_generator_delegate_aura.h" 24 #include "ui/aura/test/event_generator_delegate_aura.h"
25 #include "ui/base/ime/input_method_initializer.h" 25 #include "ui/base/ime/input_method_initializer.h"
26 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 26 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
27 #include "ui/compositor/test/context_factories_for_test.h" 27 #include "ui/compositor/test/context_factories_for_test.h"
28 #include "ui/message_center/message_center.h" 28 #include "ui/message_center/message_center.h"
29 #include "ui/wm/core/capture_controller.h" 29 #include "ui/wm/core/capture_controller.h"
30 30
31 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
32 #include "chromeos/audio/cras_audio_handler.h" 32 #include "chromeos/audio/cras_audio_handler.h"
33 #include "chromeos/dbus/dbus_thread_manager.h" 33 #include "chromeos/dbus/dbus_thread_manager.h"
34 #include "device/bluetooth/dbus/bluez_dbus_manager.h"
34 #endif 35 #endif
35 36
36 #if defined(OS_WIN) 37 #if defined(OS_WIN)
37 #include "base/win/windows_version.h" 38 #include "base/win/windows_version.h"
38 #endif 39 #endif
39 40
40 #if defined(USE_X11) 41 #if defined(USE_X11)
41 #include "ui/aura/window_tree_host_x11.h" 42 #include "ui/aura/window_tree_host_x11.h"
42 #endif 43 #endif
43 44
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 test_shell_delegate_ = new TestShellDelegate; 80 test_shell_delegate_ = new TestShellDelegate;
80 81
81 // Creates MessageCenter since g_browser_process is not created in AshTestBase 82 // Creates MessageCenter since g_browser_process is not created in AshTestBase
82 // tests. 83 // tests.
83 message_center::MessageCenter::Initialize(); 84 message_center::MessageCenter::Initialize();
84 85
85 #if defined(OS_CHROMEOS) 86 #if defined(OS_CHROMEOS)
86 // Create DBusThreadManager for testing. 87 // Create DBusThreadManager for testing.
87 if (!chromeos::DBusThreadManager::IsInitialized()) { 88 if (!chromeos::DBusThreadManager::IsInitialized()) {
88 chromeos::DBusThreadManager::Initialize(); 89 chromeos::DBusThreadManager::Initialize();
90 bluez::BluezDBusManager::Initialize(
91 chromeos::DBusThreadManager::Get()->GetSystemBus(),
92 chromeos::DBusThreadManager::Get()->IsUsingStub(
93 chromeos::DBusClientBundle::BLUETOOTH));
89 dbus_thread_manager_initialized_ = true; 94 dbus_thread_manager_initialized_ = true;
90 } 95 }
96
91 // Create CrasAudioHandler for testing since g_browser_process is not 97 // Create CrasAudioHandler for testing since g_browser_process is not
92 // created in AshTestBase tests. 98 // created in AshTestBase tests.
93 chromeos::CrasAudioHandler::InitializeForTesting(); 99 chromeos::CrasAudioHandler::InitializeForTesting();
94 #endif 100 #endif
95 ShellInitParams init_params; 101 ShellInitParams init_params;
96 init_params.delegate = test_shell_delegate_; 102 init_params.delegate = test_shell_delegate_;
97 init_params.context_factory = context_factory; 103 init_params.context_factory = context_factory;
98 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 104 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
99 ash::Shell::CreateInstance(init_params); 105 ash::Shell::CreateInstance(init_params);
100 aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup( 106 aura::test::EnvTestHelper(aura::Env::GetInstance()).SetInputStateLookup(
(...skipping 17 matching lines...) Expand all
118 // Tear down the shell. 124 // Tear down the shell.
119 Shell::DeleteInstance(); 125 Shell::DeleteInstance();
120 test_screenshot_delegate_ = NULL; 126 test_screenshot_delegate_ = NULL;
121 127
122 // Remove global message center state. 128 // Remove global message center state.
123 message_center::MessageCenter::Shutdown(); 129 message_center::MessageCenter::Shutdown();
124 130
125 #if defined(OS_CHROMEOS) 131 #if defined(OS_CHROMEOS)
126 chromeos::CrasAudioHandler::Shutdown(); 132 chromeos::CrasAudioHandler::Shutdown();
127 if (dbus_thread_manager_initialized_) { 133 if (dbus_thread_manager_initialized_) {
134 bluez::BluezDBusManager::Shutdown();
128 chromeos::DBusThreadManager::Shutdown(); 135 chromeos::DBusThreadManager::Shutdown();
129 dbus_thread_manager_initialized_ = false; 136 dbus_thread_manager_initialized_ = false;
130 } 137 }
131 #endif 138 #endif
132 139
133 ui::TerminateContextFactoryForTests(); 140 ui::TerminateContextFactoryForTests();
134 141
135 // Need to reset the initial login status. 142 // Need to reset the initial login status.
136 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); 143 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER);
137 144
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bool AshTestHelper::SupportsHostWindowResize() { 184 bool AshTestHelper::SupportsHostWindowResize() {
178 #if defined(OS_WIN) 185 #if defined(OS_WIN)
179 return false; 186 return false;
180 #else 187 #else
181 return true; 188 return true;
182 #endif 189 #endif
183 } 190 }
184 191
185 } // namespace test 192 } // namespace test
186 } // namespace ash 193 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698