| Index: device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
|
| diff --git a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
|
| index ed929df79b22b78f6ef96be507aaa4b04a90df0e..a9214b6263992ef146e9b9f002c6ceb30413a6fc 100644
|
| --- a/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
|
| +++ b/device/bluetooth/bluetooth_experimental_chromeos_unittest.cc
|
| @@ -755,9 +755,11 @@ TEST_F(BluetoothExperimentalChromeOSTest, DeviceProperties) {
|
| EXPECT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[0]->GetDeviceType());
|
| EXPECT_TRUE(devices[0]->IsPaired());
|
| EXPECT_FALSE(devices[0]->IsConnected());
|
| - EXPECT_FALSE(devices[0]->IsConnectable());
|
| EXPECT_FALSE(devices[0]->IsConnecting());
|
|
|
| + // Non HID devices are always connectable.
|
| + EXPECT_TRUE(devices[0]->IsConnectable());
|
| +
|
| BluetoothDevice::ServiceList uuids = devices[0]->GetServices();
|
| ASSERT_EQ(2U, uuids.size());
|
| EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb");
|
| @@ -1009,6 +1011,12 @@ TEST_F(BluetoothExperimentalChromeOSTest, ConnectUnpairableDevice) {
|
| fake_bluetooth_device_client_->GetProperties(
|
| dbus::ObjectPath(FakeBluetoothDeviceClient::kMicrosoftMousePath));
|
| EXPECT_TRUE(properties->trusted.value());
|
| +
|
| + // Verify is a HID device and is not connectable.
|
| + BluetoothDevice::ServiceList uuids = device->GetServices();
|
| + ASSERT_EQ(1U, uuids.size());
|
| + EXPECT_EQ(uuids[0], "00001124-0000-1000-8000-00805f9b34fb");
|
| + EXPECT_FALSE(device->IsConnectable());
|
| }
|
|
|
| TEST_F(BluetoothExperimentalChromeOSTest, ConnectConnectedDevice) {
|
| @@ -1196,6 +1204,12 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairAppleMouse) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Verify is a HID device and is connectable.
|
| + BluetoothDevice::ServiceList uuids = device->GetServices();
|
| + ASSERT_EQ(1U, uuids.size());
|
| + EXPECT_EQ(uuids[0], "00001124-0000-1000-8000-00805f9b34fb");
|
| + EXPECT_TRUE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(1, pairing_delegate.call_count_);
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
| @@ -1251,6 +1265,12 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairAppleKeyboard) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Verify is a HID device and is connectable.
|
| + BluetoothDevice::ServiceList uuids = device->GetServices();
|
| + ASSERT_EQ(1U, uuids.size());
|
| + EXPECT_EQ(uuids[0], "00001124-0000-1000-8000-00805f9b34fb");
|
| + EXPECT_TRUE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
|
|
| @@ -1324,6 +1344,14 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairMotorolaKeyboard) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Verify is a HID device.
|
| + BluetoothDevice::ServiceList uuids = device->GetServices();
|
| + ASSERT_EQ(1U, uuids.size());
|
| + EXPECT_EQ(uuids[0], "00001124-0000-1000-8000-00805f9b34fb");
|
| +
|
| + // Fake MotorolaKeyboard is not connectable.
|
| + EXPECT_FALSE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
|
|
| @@ -1378,6 +1406,13 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairSonyHeadphones) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Verify is not a HID device.
|
| + BluetoothDevice::ServiceList uuids = device->GetServices();
|
| + ASSERT_EQ(0U, uuids.size());
|
| +
|
| + // Non HID devices are always connectable.
|
| + EXPECT_TRUE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(2, pairing_delegate.call_count_);
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
| @@ -1434,6 +1469,9 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairPhone) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Non HID devices are always connectable.
|
| + EXPECT_TRUE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(2, pairing_delegate.call_count_);
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
| @@ -1491,6 +1529,9 @@ TEST_F(BluetoothExperimentalChromeOSTest, PairWeirdDevice) {
|
|
|
| EXPECT_TRUE(device->IsPaired());
|
|
|
| + // Non HID devices are always connectable.
|
| + EXPECT_TRUE(device->IsConnectable());
|
| +
|
| // Pairing dialog should be dismissed
|
| EXPECT_EQ(2, pairing_delegate.call_count_);
|
| EXPECT_EQ(1, pairing_delegate.dismiss_count_);
|
|
|