OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluetooth_adapter.h" | 5 #include "device/bluetooth/bluetooth_adapter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 EXPECT_EQ(BluetoothDevice::UUIDSet({heart_service_uuid}), pair.second); | 1045 EXPECT_EQ(BluetoothDevice::UUIDSet({heart_service_uuid}), pair.second); |
1046 } | 1046 } |
1047 EXPECT_EQ(BluetoothDevice::UUIDSet({heart_service_uuid}), | 1047 EXPECT_EQ(BluetoothDevice::UUIDSet({heart_service_uuid}), |
1048 RetrieveConnectedPeripheralServiceUUIDs()); | 1048 RetrieveConnectedPeripheralServiceUUIDs()); |
1049 | 1049 |
1050 EXPECT_EQ(0, observer.device_added_count()); | 1050 EXPECT_EQ(0, observer.device_added_count()); |
1051 EXPECT_EQ(1u, adapter_->GetDevices().size()); | 1051 EXPECT_EQ(1u, adapter_->GetDevices().size()); |
1052 } | 1052 } |
1053 #endif // defined(OS_MACOSX) | 1053 #endif // defined(OS_MACOSX) |
1054 | 1054 |
| 1055 #if defined(OS_MACOSX) |
| 1056 TEST_F(BluetoothTest, NotConnectableLowEnergyDevice) { |
| 1057 if (!PlatformSupportsLowEnergy()) { |
| 1058 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| 1059 return; |
| 1060 } |
| 1061 InitWithFakeAdapter(); |
| 1062 TestBluetoothAdapterObserver observer(adapter_); |
| 1063 |
| 1064 // Start discovery and find a device. |
| 1065 StartLowEnergyDiscoverySession(); |
| 1066 SimulateLowEnergyDevice(6); |
| 1067 BluetoothDevice* device = adapter_->GetDevice(observer.last_device_address()); |
| 1068 EXPECT_TRUE(device); |
| 1069 EXPECT_FALSE(device->IsConnectable()); |
| 1070 } |
| 1071 #endif // defined(OS_MACOSX) |
| 1072 |
1055 } // namespace device | 1073 } // namespace device |
OLD | NEW |