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

Unified Diff: device/bluetooth/bluetooth_adapter_unittest.cc

Issue 2339253002: bluetooth: mac: add connected LE devices to chooser (Closed)
Patch Set: Adding BluetoothAdapter::RetrievedConnectedPeripherals() and the implementation in BluetoothAdapter… Created 4 years, 3 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 24a77b7f51ab66dec6ec0ffa936877f4c261624d..9e6bac217f589f2fb01f075a3b984b64af595745 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -870,4 +870,23 @@ 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();
+ // Start discovery and find a device.
+ StartLowEnergyDiscoverySession();
+ SimulateLowEnergyDevice(4);
+ EXPECT_EQ(2, observer.device_added_count());
+ EXPECT_EQ(2u, adapter_->GetDevices().size());
+}
+#endif // defined(OS_MACOSX)
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698