Index: components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc |
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc |
index b41ec03c16cc7a50cf9b529cdbcbc8ec3f7b24fe..4cb745cf3b12a58ca9a4c17f35a0c9c0a493bcfb 100644 |
--- a/components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc |
+++ b/components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc |
@@ -366,9 +366,11 @@ TEST_F(ProximityAuthBluetoothLowEnergyConnectionFinderTest, |
connection_finder.DeviceAdded(adapter_.get(), device_.get()); |
// Creating a connection. |
+ base::RunLoop run_loop; |
EXPECT_FALSE(last_found_connection_); |
connection->SetStatus(Connection::IN_PROGRESS); |
connection->SetStatus(Connection::CONNECTED); |
+ run_loop.RunUntilIdle(); |
EXPECT_TRUE(last_found_connection_); |
} |
@@ -424,9 +426,11 @@ TEST_F(ProximityAuthBluetoothLowEnergyConnectionFinderTest, |
EXPECT_CALL(*last_discovery_session_alias_, Stop(_, _)).Times(AtLeast(1)); |
// Completing the connection. |
+ base::RunLoop run_loop; |
EXPECT_FALSE(last_found_connection_); |
connection->SetStatus(Connection::IN_PROGRESS); |
connection->SetStatus(Connection::CONNECTED); |
+ run_loop.RunUntilIdle(); |
EXPECT_TRUE(last_found_connection_); |
} |
@@ -475,9 +479,11 @@ TEST_F(ProximityAuthBluetoothLowEnergyConnectionFinderTest, |
EXPECT_CALL(*last_discovery_session_alias_, Stop(_, _)).Times(AtLeast(1)); |
// Completing the connection. |
+ base::RunLoop run_loop; |
ASSERT_FALSE(last_found_connection_); |
connection->SetStatus(Connection::IN_PROGRESS); |
connection->SetStatus(Connection::CONNECTED); |
+ run_loop.RunUntilIdle(); |
EXPECT_TRUE(last_found_connection_); |
} |