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

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc

Issue 1277483007: Implement finding BLE connections in chrome://proximity-auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor unit test Created 5 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
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_);
}

Powered by Google App Engine
This is Rietveld 408576698