diff options
Diffstat (limited to 'device/bluetooth/bluetooth_socket_bluez_unittest.cc')
-rw-r--r-- | device/bluetooth/bluetooth_socket_bluez_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_socket_bluez_unittest.cc b/device/bluetooth/bluetooth_socket_bluez_unittest.cc index 171d77d..80585bc 100644 --- a/device/bluetooth/bluetooth_socket_bluez_unittest.cc +++ b/device/bluetooth/bluetooth_socket_bluez_unittest.cc @@ -78,6 +78,9 @@ class BluetoothSocketBlueZTest : public testing::Test { // Grab a pointer to the adapter. device::BluetoothAdapterFactory::GetAdapter(base::Bind( &BluetoothSocketBlueZTest::AdapterCallback, base::Unretained(this))); + + base::MessageLoop::current()->Run(); + ASSERT_TRUE(adapter_.get() != nullptr); ASSERT_TRUE(adapter_->IsInitialized()); ASSERT_TRUE(adapter_->IsPresent()); @@ -96,6 +99,10 @@ class BluetoothSocketBlueZTest : public testing::Test { void AdapterCallback(scoped_refptr<BluetoothAdapter> adapter) { adapter_ = adapter; + if (base::MessageLoop::current() && + base::MessageLoop::current()->is_running()) { + base::MessageLoop::current()->QuitWhenIdle(); + } } void SuccessCallback() { |