diff options
author | rkc <rkc@chromium.org> | 2015-11-04 17:55:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-05 01:56:30 +0000 |
commit | 06c92c041f3b7b62bcddec714fb886b431865057 (patch) | |
tree | 1745f16086c453e1671e6b02df73626cded2f295 /ash | |
parent | a9ed17edd6831510d2d50680824740a485ae25d6 (diff) | |
download | chromium_src-06c92c041f3b7b62bcddec714fb886b431865057.zip chromium_src-06c92c041f3b7b62bcddec714fb886b431865057.tar.gz chromium_src-06c92c041f3b7b62bcddec714fb886b431865057.tar.bz2 |
Reland: Refactor DBusThreadManager to split away BT clients.
This is a reland of
This CL doesn't change any of the code except for merge and lint changes.
The original CL was triggering a test crash in Valgrind. On this patch,
I've run Valgrind multiple times locally and also additionally run TSan.
Since I am seeing no failures, after talking to glider@ (who works on
Valgrind), I'm attempting to re-land this CL.
TBR=armansito@chromium.org, glider@chromium.org, isherman@chromium.org, oshima@chromium.org, sky@chromium.org, stevenjb@chromium.org
BUG=None.
Committed: c56b94daaf6513891e7da3094ab5054ffbd6262
Cr-Commit-Position: refs/heads/master@{#357707}
Review URL: https://codereview.chromium.org/1411793010
Cr-Commit-Position: refs/heads/master@{#357976}
Diffstat (limited to 'ash')
-rw-r--r-- | ash/test/ash_test_helper.cc | 15 | ||||
-rw-r--r-- | ash/test/ash_test_helper.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 995b9f5..560f8ef 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -32,6 +32,7 @@ #if defined(OS_CHROMEOS) #include "chromeos/audio/cras_audio_handler.h" #include "chromeos/dbus/dbus_thread_manager.h" +#include "device/bluetooth/dbus/bluez_dbus_manager.h" #endif #if defined(OS_WIN) @@ -54,6 +55,7 @@ AshTestHelper::AshTestHelper(base::MessageLoopForUI* message_loop) CHECK(message_loop_); #if defined(OS_CHROMEOS) dbus_thread_manager_initialized_ = false; + bluez_dbus_manager_initialized_ = false; #endif #if defined(USE_X11) aura::test::SetUseOverrideRedirectWindowByDefault(true); @@ -91,6 +93,15 @@ void AshTestHelper::SetUp(bool start_session) { chromeos::DBusThreadManager::Initialize(); dbus_thread_manager_initialized_ = true; } + + if (!bluez::BluezDBusManager::IsInitialized()) { + bluez::BluezDBusManager::Initialize( + chromeos::DBusThreadManager::Get()->GetSystemBus(), + chromeos::DBusThreadManager::Get()->IsUsingStub( + chromeos::DBusClientBundle::BLUETOOTH)); + bluez_dbus_manager_initialized_ = true; + } + // Create CrasAudioHandler for testing since g_browser_process is not // created in AshTestBase tests. chromeos::CrasAudioHandler::InitializeForTesting(); @@ -136,6 +147,10 @@ void AshTestHelper::TearDown() { #if defined(OS_CHROMEOS) chromeos::CrasAudioHandler::Shutdown(); + if (bluez_dbus_manager_initialized_) { + bluez::BluezDBusManager::Shutdown(); + bluez_dbus_manager_initialized_ = false; + } if (dbus_thread_manager_initialized_) { chromeos::DBusThreadManager::Shutdown(); dbus_thread_manager_initialized_ = false; diff --git a/ash/test/ash_test_helper.h b/ash/test/ash_test_helper.h index daa3316..e324fe4 100644 --- a/ash/test/ash_test_helper.h +++ b/ash/test/ash_test_helper.h @@ -101,6 +101,8 @@ class AshTestHelper { #if defined(OS_CHROMEOS) // Check if DBus Thread Manager was initialized here. bool dbus_thread_manager_initialized_; + // Check if Bluez DBus Manager was initialized here. + bool bluez_dbus_manager_initialized_; #endif DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |