Index: device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc |
diff --git a/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc b/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc |
index ac7677b8b4c1cfa261b8794175ad252757671653..bf5a04befd2f553d8f04d7dc85061c359ddfefbf 100644 |
--- a/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc |
+++ b/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc |
@@ -52,8 +52,10 @@ class BluetoothAdapterDevicesChromeOsTest : public testing::Test { |
EXPECT_CALL(*mock_adapter_client_, AddObserver(_)) |
.Times(1); |
- adapter_ = BluetoothAdapterFactory::DefaultAdapter(); |
- ASSERT_TRUE(adapter_.get() != NULL); |
+ BluetoothAdapterFactory::RunCallbackOnAdapterReady( |
+ base::Bind(&BluetoothAdapterDevicesChromeOsTest::SetAdapter, |
+ base::Unretained(this))); |
+ ASSERT_TRUE(adapter_ != NULL); |
// Call the adapter callback; |
// BluetoothAdapterClient::GetProperties will be called once to obtain |
@@ -96,6 +98,10 @@ class BluetoothAdapterDevicesChromeOsTest : public testing::Test { |
DBusThreadManager::Shutdown(); |
} |
+ void SetAdapter(scoped_refptr<device::BluetoothAdapter> adapter) { |
+ adapter_ = adapter; |
+ } |
+ |
protected: |
MockBluetoothManagerClient* mock_manager_client_; |
MockBluetoothAdapterClient* mock_adapter_client_; |