Chromium Code Reviews| Index: device/bluetooth/bluetooth_device_unittest.cc |
| diff --git a/device/bluetooth/bluetooth_device_unittest.cc b/device/bluetooth/bluetooth_device_unittest.cc |
| index 40880bef96a46cb3b19dffc58fd88cf484d75ff2..95bb83c2197fa22b741d90ebbb643644247d80b4 100644 |
| --- a/device/bluetooth/bluetooth_device_unittest.cc |
| +++ b/device/bluetooth/bluetooth_device_unittest.cc |
| @@ -115,6 +115,34 @@ TEST_F(BluetoothTest, LowEnergyDeviceNoUUIDs) { |
| } |
| #endif // defined(OS_ANDROID) || defined(OS_MACOSX) || defined(OS_WIN) |
| +#if defined(OS_ANDROID) |
| +// GetDeviceName for Device with name. |
| +TEST_F(BluetoothTest, GetDeviceName) { |
| + if (!PlatformSupportsLowEnergy()) { |
| + LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| + return; |
| + } |
| + InitWithFakeAdapter(); |
| + StartLowEnergyDiscoverySession(); |
| + BluetoothDevice* device = DiscoverLowEnergyDevice(1); |
| + EXPECT_EQ("FakeBluetoothDevice", device->GetDeviceName()); |
|
scheib
2016/04/11 17:58:12
We already have LowEnergyDeviceProperties that tes
ortuno
2016/04/11 18:11:58
Removed the test. Should I add a call to GetDevice
|
| +} |
| +#endif // defined(OS_ANDROID) |
| + |
| +#if defined(OS_ANDROID) |
| +// GetDeviceName for Device with no name. |
| +TEST_F(BluetoothTest, GetDeviceName_NullName) { |
| + if (!PlatformSupportsLowEnergy()) { |
| + LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| + return; |
| + } |
| + InitWithFakeAdapter(); |
| + StartLowEnergyDiscoverySession(); |
| + BluetoothDevice* device = DiscoverLowEnergyDevice(5); |
|
scheib
2016/04/11 17:58:12
Document '5' in bluetooth/test/bluetooth_test.h
ortuno
2016/04/11 18:11:58
Done.
|
| + EXPECT_EQ("", device->GetDeviceName()); |
| +} |
| +#endif // defined(OS_ANDROID) |
| + |
| // TODO(scheib): Test with a device with no name. http://crbug.com/506415 |
| // BluetoothDevice::GetAddressWithLocalizedDeviceTypeName() will run, which |
| // requires string resources to be loaded. For that, something like |