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

Unified Diff: device/bluetooth/bluetooth_chromeos_unittest.cc

Issue 444263002: Added switch that let us 'un-stub' certain dbus clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/mixed_dbus_thread_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_chromeos_unittest.cc b/device/bluetooth/bluetooth_chromeos_unittest.cc
index 379d1dfd25fc6994e462d11726f63e0f80651331..87b454f17a2c6f8e7c8f2d000f86e42860fb03f7 100644
--- a/device/bluetooth/bluetooth_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_chromeos_unittest.cc
@@ -235,6 +235,10 @@ class BluetoothChromeOSTest : public testing::Test {
public:
virtual void SetUp() {
FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager;
+ // We need to initialize DBusThreadManager early to prevent
+ // Bluetooth*::Create() methods from picking the real instead of fake
+ // implementations.
+ DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
fake_bluetooth_adapter_client_ = new FakeBluetoothAdapterClient;
fake_dbus_thread_manager->SetBluetoothAdapterClient(
scoped_ptr<BluetoothAdapterClient>(fake_bluetooth_adapter_client_));
@@ -249,7 +253,6 @@ class BluetoothChromeOSTest : public testing::Test {
fake_dbus_thread_manager->SetBluetoothGattServiceClient(
scoped_ptr<BluetoothGattServiceClient>(
new FakeBluetoothGattServiceClient));
- DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
fake_bluetooth_adapter_client_->SetSimulationIntervalMs(10);
« no previous file with comments | « chromeos/dbus/mixed_dbus_thread_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698