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

Unified Diff: device/bluetooth/bluetooth_adapter_unittest.cc

Issue 2339253002: bluetooth: mac: add connected LE devices to chooser (Closed)
Patch Set: Better implementation Created 4 years, 2 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: device/bluetooth/bluetooth_adapter_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index 06829a88dd6d1887fcf14d537b923cb42bd52a56..317f20d1318f4146fb46cf4da4aa94891aea2c72 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -865,4 +865,22 @@ TEST_F(BluetoothTest, RemoveOutdatedDeviceGattConnect) {
}
#endif // defined(OS_ANDROID) || defined(OS_MACOSX)
+#if defined(OS_MACOSX)
+// Simulate a device being connected before starting discovery session.
+TEST_F(BluetoothTest, DiscoverConnectedLowEnergyDevice) {
+ if (!PlatformSupportsLowEnergy()) {
+ LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
+ return;
+ }
+ InitWithFakeAdapter();
+ TestBluetoothAdapterObserver observer(adapter_);
+
+ SimulateConnectedLowEnergyDevice();
+ adapter_->RetrieveUnknownGattConnectedDevices();
+
+ EXPECT_EQ(1, observer.device_added_count());
+ EXPECT_EQ(1u, adapter_->GetDevices().size());
+}
+#endif // defined(OS_MACOSX)
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698