summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_advertisement_bluez_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'device/bluetooth/bluetooth_advertisement_bluez_unittest.cc')
-rw-r--r--device/bluetooth/bluetooth_advertisement_bluez_unittest.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_advertisement_bluez_unittest.cc b/device/bluetooth/bluetooth_advertisement_bluez_unittest.cc
index 27b2c8f..4e07002 100644
--- a/device/bluetooth/bluetooth_advertisement_bluez_unittest.cc
+++ b/device/bluetooth/bluetooth_advertisement_bluez_unittest.cc
@@ -80,6 +80,7 @@ class BluetoothAdvertisementBlueZTest : public testing::Test {
BluetoothAdapterFactory::GetAdapter(
base::Bind(&BluetoothAdvertisementBlueZTest::GetAdapterCallback,
base::Unretained(this)));
+ base::MessageLoop::current()->Run();
}
// Called whenever BluetoothAdapter is retrieved successfully.
@@ -87,6 +88,10 @@ class BluetoothAdvertisementBlueZTest : public testing::Test {
adapter_ = adapter;
ASSERT_NE(adapter_.get(), nullptr);
ASSERT_TRUE(adapter_->IsInitialized());
+ if (base::MessageLoop::current() &&
+ base::MessageLoop::current()->is_running()) {
+ base::MessageLoop::current()->QuitWhenIdle();
+ }
}
scoped_ptr<BluetoothAdvertisement::Data> CreateAdvertisementData() {