OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chromeos/chromeos_switches.h" | 8 #include "chromeos/chromeos_switches.h" |
9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" | 9 #include "chromeos/dbus/fake_bluetooth_adapter_client.h" |
10 #include "chromeos/dbus/fake_bluetooth_device_client.h" | 10 #include "chromeos/dbus/fake_bluetooth_device_client.h" |
11 #include "chromeos/dbus/fake_bluetooth_input_client.h" | |
11 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h" | 12 #include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h" |
12 #include "dbus/object_path.h" | 13 #include "dbus/object_path.h" |
13 #include "device/bluetooth/bluetooth_adapter.h" | 14 #include "device/bluetooth/bluetooth_adapter.h" |
14 #include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h" | 15 #include "device/bluetooth/bluetooth_adapter_experimental_chromeos.h" |
15 #include "device/bluetooth/bluetooth_adapter_factory.h" | 16 #include "device/bluetooth/bluetooth_adapter_factory.h" |
16 #include "device/bluetooth/bluetooth_device.h" | 17 #include "device/bluetooth/bluetooth_device.h" |
17 #include "device/bluetooth/bluetooth_device_experimental_chromeos.h" | 18 #include "device/bluetooth/bluetooth_device_experimental_chromeos.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
19 | 20 |
20 using device::BluetoothAdapter; | 21 using device::BluetoothAdapter; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 chromeos::switches::kEnableExperimentalBluetooth); | 203 chromeos::switches::kEnableExperimentalBluetooth); |
203 | 204 |
204 mock_dbus_thread_manager_ = | 205 mock_dbus_thread_manager_ = |
205 new MockDBusThreadManagerWithoutGMock(); | 206 new MockDBusThreadManagerWithoutGMock(); |
206 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager_); | 207 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager_); |
207 | 208 |
208 fake_bluetooth_adapter_client_ = | 209 fake_bluetooth_adapter_client_ = |
209 mock_dbus_thread_manager_->fake_bluetooth_adapter_client(); | 210 mock_dbus_thread_manager_->fake_bluetooth_adapter_client(); |
210 fake_bluetooth_device_client_ = | 211 fake_bluetooth_device_client_ = |
211 mock_dbus_thread_manager_->fake_bluetooth_device_client(); | 212 mock_dbus_thread_manager_->fake_bluetooth_device_client(); |
213 fake_bluetooth_input_client_ = | |
214 mock_dbus_thread_manager_->fake_bluetooth_input_client(); | |
212 | 215 |
213 callback_count_ = 0; | 216 callback_count_ = 0; |
214 error_callback_count_ = 0; | 217 error_callback_count_ = 0; |
215 last_connect_error_ = BluetoothDevice::ERROR_UNKNOWN; | 218 last_connect_error_ = BluetoothDevice::ERROR_UNKNOWN; |
216 } | 219 } |
217 | 220 |
218 virtual void TearDown() { | 221 virtual void TearDown() { |
219 adapter_ = NULL; | 222 adapter_ = NULL; |
220 DBusThreadManager::Shutdown(); | 223 DBusThreadManager::Shutdown(); |
221 } | 224 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 // Run a discovery phase so we have devices that can be paired with. | 302 // Run a discovery phase so we have devices that can be paired with. |
300 void DiscoverDevices() { | 303 void DiscoverDevices() { |
301 // Pass an invalid address for the device so that the discovery process | 304 // Pass an invalid address for the device so that the discovery process |
302 // completes with all devices. | 305 // completes with all devices. |
303 DiscoverDevice("does not exist"); | 306 DiscoverDevice("does not exist"); |
304 } | 307 } |
305 | 308 |
306 protected: | 309 protected: |
307 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_; | 310 FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_; |
308 FakeBluetoothDeviceClient* fake_bluetooth_device_client_; | 311 FakeBluetoothDeviceClient* fake_bluetooth_device_client_; |
312 FakeBluetoothInputClient* fake_bluetooth_input_client_; | |
309 MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager_; | 313 MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager_; |
310 scoped_refptr<BluetoothAdapter> adapter_; | 314 scoped_refptr<BluetoothAdapter> adapter_; |
311 | 315 |
312 int callback_count_; | 316 int callback_count_; |
313 int error_callback_count_; | 317 int error_callback_count_; |
314 enum BluetoothDevice::ConnectErrorCode last_connect_error_; | 318 enum BluetoothDevice::ConnectErrorCode last_connect_error_; |
315 }; | 319 }; |
316 | 320 |
317 TEST_F(BluetoothExperimentalChromeOSTest, AlreadyPresent) { | 321 TEST_F(BluetoothExperimentalChromeOSTest, AlreadyPresent) { |
318 GetAdapter(); | 322 GetAdapter(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 ASSERT_EQ(1U, devices.size()); | 739 ASSERT_EQ(1U, devices.size()); |
736 ASSERT_EQ(FakeBluetoothDeviceClient::kPairedDeviceAddress, | 740 ASSERT_EQ(FakeBluetoothDeviceClient::kPairedDeviceAddress, |
737 devices[0]->GetAddress()); | 741 devices[0]->GetAddress()); |
738 | 742 |
739 // Verify the other device properties. | 743 // Verify the other device properties. |
740 EXPECT_EQ(UTF8ToUTF16(FakeBluetoothDeviceClient::kPairedDeviceName), | 744 EXPECT_EQ(UTF8ToUTF16(FakeBluetoothDeviceClient::kPairedDeviceName), |
741 devices[0]->GetName()); | 745 devices[0]->GetName()); |
742 EXPECT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[0]->GetDeviceType()); | 746 EXPECT_EQ(BluetoothDevice::DEVICE_COMPUTER, devices[0]->GetDeviceType()); |
743 EXPECT_TRUE(devices[0]->IsPaired()); | 747 EXPECT_TRUE(devices[0]->IsPaired()); |
744 EXPECT_FALSE(devices[0]->IsConnected()); | 748 EXPECT_FALSE(devices[0]->IsConnected()); |
745 EXPECT_FALSE(devices[0]->IsConnectable()); | |
746 EXPECT_FALSE(devices[0]->IsConnecting()); | 749 EXPECT_FALSE(devices[0]->IsConnecting()); |
747 | 750 |
751 // Non HID devices are always connectable. | |
752 EXPECT_TRUE(devices[0]->IsConnectable()); | |
753 | |
748 BluetoothDevice::ServiceList uuids = devices[0]->GetServices(); | 754 BluetoothDevice::ServiceList uuids = devices[0]->GetServices(); |
749 ASSERT_EQ(2U, uuids.size()); | 755 ASSERT_EQ(2U, uuids.size()); |
750 EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb"); | 756 EXPECT_EQ(uuids[0], "00001800-0000-1000-8000-00805f9b34fb"); |
751 EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb"); | 757 EXPECT_EQ(uuids[1], "00001801-0000-1000-8000-00805f9b34fb"); |
752 } | 758 } |
753 | 759 |
754 TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) { | 760 TEST_F(BluetoothExperimentalChromeOSTest, DeviceClassChanged) { |
755 // Simulate a change of class of a device, as sometimes occurs | 761 // Simulate a change of class of a device, as sometimes occurs |
756 // during discovery. | 762 // during discovery. |
757 GetAdapter(); | 763 GetAdapter(); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1107 &pairing_delegate, | 1113 &pairing_delegate, |
1108 base::Bind(&BluetoothExperimentalChromeOSTest::Callback, | 1114 base::Bind(&BluetoothExperimentalChromeOSTest::Callback, |
1109 base::Unretained(this)), | 1115 base::Unretained(this)), |
1110 base::Bind(&BluetoothExperimentalChromeOSTest::ConnectErrorCallback, | 1116 base::Bind(&BluetoothExperimentalChromeOSTest::ConnectErrorCallback, |
1111 base::Unretained(this))); | 1117 base::Unretained(this))); |
1112 | 1118 |
1113 EXPECT_EQ(0, pairing_delegate.call_count_); | 1119 EXPECT_EQ(0, pairing_delegate.call_count_); |
1114 EXPECT_TRUE(device->IsConnecting()); | 1120 EXPECT_TRUE(device->IsConnecting()); |
1115 | 1121 |
1116 message_loop.Run(); | 1122 message_loop.Run(); |
1123 fake_bluetooth_input_client_->AddInputDevice( | |
1124 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleMousePath)); | |
keybuk
2013/04/18 20:50:25
This should be handled by the FakeBluetoothDeviceC
deymo
2013/04/18 22:19:55
Done. This is emulated by FakeBluetoothDeviceClien
| |
1117 | 1125 |
1118 EXPECT_EQ(1, callback_count_); | 1126 EXPECT_EQ(1, callback_count_); |
1119 EXPECT_EQ(0, error_callback_count_); | 1127 EXPECT_EQ(0, error_callback_count_); |
1120 | 1128 |
1121 // One change for connected, and one for paired. | 1129 // One change for connected, and one for paired. |
1122 EXPECT_EQ(2, observer.device_changed_count_); | 1130 EXPECT_EQ(2, observer.device_changed_count_); |
1123 EXPECT_EQ(device, observer.last_device_); | 1131 EXPECT_EQ(device, observer.last_device_); |
1124 | 1132 |
1125 EXPECT_TRUE(device->IsConnected()); | 1133 EXPECT_TRUE(device->IsConnected()); |
1126 EXPECT_FALSE(device->IsConnecting()); | 1134 EXPECT_FALSE(device->IsConnecting()); |
1127 | 1135 |
1128 EXPECT_TRUE(device->IsPaired()); | 1136 EXPECT_TRUE(device->IsPaired()); |
1137 EXPECT_TRUE(device->IsConnectable()); | |
1129 | 1138 |
1130 // Pairing dialog should be dismissed | 1139 // Pairing dialog should be dismissed |
1131 EXPECT_EQ(1, pairing_delegate.call_count_); | 1140 EXPECT_EQ(1, pairing_delegate.call_count_); |
1132 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1141 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1133 | 1142 |
1134 // Make sure the trusted property has been set to true. | 1143 // Make sure the trusted property has been set to true. |
1135 FakeBluetoothDeviceClient::Properties* properties = | 1144 FakeBluetoothDeviceClient::Properties* properties = |
1136 fake_bluetooth_device_client_->GetProperties( | 1145 fake_bluetooth_device_client_->GetProperties( |
1137 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleMousePath)); | 1146 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleMousePath)); |
1138 EXPECT_TRUE(properties->trusted.value()); | 1147 EXPECT_TRUE(properties->trusted.value()); |
(...skipping 23 matching lines...) Expand all Loading... | |
1162 base::Unretained(this)), | 1171 base::Unretained(this)), |
1163 base::Bind(&BluetoothExperimentalChromeOSTest::ConnectErrorCallback, | 1172 base::Bind(&BluetoothExperimentalChromeOSTest::ConnectErrorCallback, |
1164 base::Unretained(this))); | 1173 base::Unretained(this))); |
1165 | 1174 |
1166 EXPECT_EQ(1, pairing_delegate.call_count_); | 1175 EXPECT_EQ(1, pairing_delegate.call_count_); |
1167 EXPECT_EQ(1, pairing_delegate.display_pincode_count_); | 1176 EXPECT_EQ(1, pairing_delegate.display_pincode_count_); |
1168 EXPECT_EQ("123456", pairing_delegate.last_pincode_); | 1177 EXPECT_EQ("123456", pairing_delegate.last_pincode_); |
1169 EXPECT_TRUE(device->IsConnecting()); | 1178 EXPECT_TRUE(device->IsConnecting()); |
1170 | 1179 |
1171 message_loop.Run(); | 1180 message_loop.Run(); |
1181 fake_bluetooth_input_client_->AddInputDevice( | |
1182 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleKeyboardPath)); | |
keybuk
2013/04/18 20:50:25
ditto
| |
1172 | 1183 |
1173 EXPECT_EQ(1, callback_count_); | 1184 EXPECT_EQ(1, callback_count_); |
1174 EXPECT_EQ(0, error_callback_count_); | 1185 EXPECT_EQ(0, error_callback_count_); |
1175 | 1186 |
1176 // One change for connected, and one for paired. | 1187 // One change for connected, and one for paired. |
1177 EXPECT_EQ(2, observer.device_changed_count_); | 1188 EXPECT_EQ(2, observer.device_changed_count_); |
1178 EXPECT_EQ(device, observer.last_device_); | 1189 EXPECT_EQ(device, observer.last_device_); |
1179 | 1190 |
1180 EXPECT_TRUE(device->IsConnected()); | 1191 EXPECT_TRUE(device->IsConnected()); |
1181 EXPECT_FALSE(device->IsConnecting()); | 1192 EXPECT_FALSE(device->IsConnecting()); |
1182 | 1193 |
1183 EXPECT_TRUE(device->IsPaired()); | 1194 EXPECT_TRUE(device->IsPaired()); |
1195 EXPECT_TRUE(device->IsConnectable()); | |
1184 | 1196 |
1185 // Pairing dialog should be dismissed | 1197 // Pairing dialog should be dismissed |
1186 EXPECT_EQ(2, pairing_delegate.call_count_); | 1198 EXPECT_EQ(2, pairing_delegate.call_count_); |
1187 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1199 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1188 | 1200 |
1189 // Make sure the trusted property has been set to true. | 1201 // Make sure the trusted property has been set to true. |
1190 FakeBluetoothDeviceClient::Properties* properties = | 1202 FakeBluetoothDeviceClient::Properties* properties = |
1191 fake_bluetooth_device_client_->GetProperties( | 1203 fake_bluetooth_device_client_->GetProperties( |
1192 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleKeyboardPath)); | 1204 dbus::ObjectPath(FakeBluetoothDeviceClient::kAppleKeyboardPath)); |
1193 EXPECT_TRUE(properties->trusted.value()); | 1205 EXPECT_TRUE(properties->trusted.value()); |
(...skipping 25 matching lines...) Expand all Loading... | |
1219 base::Unretained(this))); | 1231 base::Unretained(this))); |
1220 | 1232 |
1221 EXPECT_EQ(1, pairing_delegate.call_count_); | 1233 EXPECT_EQ(1, pairing_delegate.call_count_); |
1222 EXPECT_EQ(1, pairing_delegate.display_passkey_count_); | 1234 EXPECT_EQ(1, pairing_delegate.display_passkey_count_); |
1223 EXPECT_EQ(123456U, pairing_delegate.last_passkey_); | 1235 EXPECT_EQ(123456U, pairing_delegate.last_passkey_); |
1224 EXPECT_TRUE(device->IsConnecting()); | 1236 EXPECT_TRUE(device->IsConnecting()); |
1225 | 1237 |
1226 // TODO(keybuk): verify we get typing notifications | 1238 // TODO(keybuk): verify we get typing notifications |
1227 | 1239 |
1228 message_loop.Run(); | 1240 message_loop.Run(); |
1241 fake_bluetooth_input_client_->AddInputDevice( | |
1242 dbus::ObjectPath(FakeBluetoothDeviceClient::kMotorolaKeyboardPath)); | |
1229 | 1243 |
1230 EXPECT_EQ(1, callback_count_); | 1244 EXPECT_EQ(1, callback_count_); |
1231 EXPECT_EQ(0, error_callback_count_); | 1245 EXPECT_EQ(0, error_callback_count_); |
1232 | 1246 |
1233 // One change for connected, and one for paired. | 1247 // One change for connected, and one for paired. |
1234 EXPECT_EQ(2, observer.device_changed_count_); | 1248 EXPECT_EQ(2, observer.device_changed_count_); |
1235 EXPECT_EQ(device, observer.last_device_); | 1249 EXPECT_EQ(device, observer.last_device_); |
1236 | 1250 |
1237 EXPECT_TRUE(device->IsConnected()); | 1251 EXPECT_TRUE(device->IsConnected()); |
1238 EXPECT_FALSE(device->IsConnecting()); | 1252 EXPECT_FALSE(device->IsConnecting()); |
1239 | 1253 |
1240 EXPECT_TRUE(device->IsPaired()); | 1254 EXPECT_TRUE(device->IsPaired()); |
1241 | 1255 |
1256 // Fake MotorolaKeyboard is not connectable. | |
1257 EXPECT_FALSE(device->IsConnectable()); | |
1258 | |
1242 // Pairing dialog should be dismissed | 1259 // Pairing dialog should be dismissed |
1243 EXPECT_EQ(2, pairing_delegate.call_count_); | 1260 EXPECT_EQ(2, pairing_delegate.call_count_); |
1244 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1261 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1245 | 1262 |
1246 // Make sure the trusted property has been set to true. | 1263 // Make sure the trusted property has been set to true. |
1247 FakeBluetoothDeviceClient::Properties* properties = | 1264 FakeBluetoothDeviceClient::Properties* properties = |
1248 fake_bluetooth_device_client_->GetProperties( | 1265 fake_bluetooth_device_client_->GetProperties( |
1249 dbus::ObjectPath(FakeBluetoothDeviceClient::kMotorolaKeyboardPath)); | 1266 dbus::ObjectPath(FakeBluetoothDeviceClient::kMotorolaKeyboardPath)); |
1250 EXPECT_TRUE(properties->trusted.value()); | 1267 EXPECT_TRUE(properties->trusted.value()); |
1251 } | 1268 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1287 | 1304 |
1288 // One change for connected, and one for paired. | 1305 // One change for connected, and one for paired. |
1289 EXPECT_EQ(2, observer.device_changed_count_); | 1306 EXPECT_EQ(2, observer.device_changed_count_); |
1290 EXPECT_EQ(device, observer.last_device_); | 1307 EXPECT_EQ(device, observer.last_device_); |
1291 | 1308 |
1292 EXPECT_TRUE(device->IsConnected()); | 1309 EXPECT_TRUE(device->IsConnected()); |
1293 EXPECT_FALSE(device->IsConnecting()); | 1310 EXPECT_FALSE(device->IsConnecting()); |
1294 | 1311 |
1295 EXPECT_TRUE(device->IsPaired()); | 1312 EXPECT_TRUE(device->IsPaired()); |
1296 | 1313 |
1314 // Non HID devices are always connectable. | |
1315 EXPECT_TRUE(device->IsConnectable()); | |
1316 | |
1297 // Pairing dialog should be dismissed | 1317 // Pairing dialog should be dismissed |
1298 EXPECT_EQ(2, pairing_delegate.call_count_); | 1318 EXPECT_EQ(2, pairing_delegate.call_count_); |
1299 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1319 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1300 | 1320 |
1301 // Make sure the trusted property has been set to true. | 1321 // Make sure the trusted property has been set to true. |
1302 FakeBluetoothDeviceClient::Properties* properties = | 1322 FakeBluetoothDeviceClient::Properties* properties = |
1303 fake_bluetooth_device_client_->GetProperties( | 1323 fake_bluetooth_device_client_->GetProperties( |
1304 dbus::ObjectPath(FakeBluetoothDeviceClient::kSonyHeadphonesPath)); | 1324 dbus::ObjectPath(FakeBluetoothDeviceClient::kSonyHeadphonesPath)); |
1305 EXPECT_TRUE(properties->trusted.value()); | 1325 EXPECT_TRUE(properties->trusted.value()); |
1306 } | 1326 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1343 | 1363 |
1344 // One change for connected, and one for paired. | 1364 // One change for connected, and one for paired. |
1345 EXPECT_EQ(2, observer.device_changed_count_); | 1365 EXPECT_EQ(2, observer.device_changed_count_); |
1346 EXPECT_EQ(device, observer.last_device_); | 1366 EXPECT_EQ(device, observer.last_device_); |
1347 | 1367 |
1348 EXPECT_TRUE(device->IsConnected()); | 1368 EXPECT_TRUE(device->IsConnected()); |
1349 EXPECT_FALSE(device->IsConnecting()); | 1369 EXPECT_FALSE(device->IsConnecting()); |
1350 | 1370 |
1351 EXPECT_TRUE(device->IsPaired()); | 1371 EXPECT_TRUE(device->IsPaired()); |
1352 | 1372 |
1373 // Non HID devices are always connectable. | |
1374 EXPECT_TRUE(device->IsConnectable()); | |
1375 | |
1353 // Pairing dialog should be dismissed | 1376 // Pairing dialog should be dismissed |
1354 EXPECT_EQ(2, pairing_delegate.call_count_); | 1377 EXPECT_EQ(2, pairing_delegate.call_count_); |
1355 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1378 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1356 | 1379 |
1357 // Make sure the trusted property has been set to true. | 1380 // Make sure the trusted property has been set to true. |
1358 FakeBluetoothDeviceClient::Properties* properties = | 1381 FakeBluetoothDeviceClient::Properties* properties = |
1359 fake_bluetooth_device_client_->GetProperties( | 1382 fake_bluetooth_device_client_->GetProperties( |
1360 dbus::ObjectPath(FakeBluetoothDeviceClient::kPhonePath)); | 1383 dbus::ObjectPath(FakeBluetoothDeviceClient::kPhonePath)); |
1361 EXPECT_TRUE(properties->trusted.value()); | 1384 EXPECT_TRUE(properties->trusted.value()); |
1362 } | 1385 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1400 | 1423 |
1401 // One change for connected, and one for paired. | 1424 // One change for connected, and one for paired. |
1402 EXPECT_EQ(2, observer.device_changed_count_); | 1425 EXPECT_EQ(2, observer.device_changed_count_); |
1403 EXPECT_EQ(device, observer.last_device_); | 1426 EXPECT_EQ(device, observer.last_device_); |
1404 | 1427 |
1405 EXPECT_TRUE(device->IsConnected()); | 1428 EXPECT_TRUE(device->IsConnected()); |
1406 EXPECT_FALSE(device->IsConnecting()); | 1429 EXPECT_FALSE(device->IsConnecting()); |
1407 | 1430 |
1408 EXPECT_TRUE(device->IsPaired()); | 1431 EXPECT_TRUE(device->IsPaired()); |
1409 | 1432 |
1433 // Non HID devices are always connectable. | |
1434 EXPECT_TRUE(device->IsConnectable()); | |
1435 | |
1410 // Pairing dialog should be dismissed | 1436 // Pairing dialog should be dismissed |
1411 EXPECT_EQ(2, pairing_delegate.call_count_); | 1437 EXPECT_EQ(2, pairing_delegate.call_count_); |
1412 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1438 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1413 | 1439 |
1414 // Make sure the trusted property has been set to true. | 1440 // Make sure the trusted property has been set to true. |
1415 FakeBluetoothDeviceClient::Properties* properties = | 1441 FakeBluetoothDeviceClient::Properties* properties = |
1416 fake_bluetooth_device_client_->GetProperties( | 1442 fake_bluetooth_device_client_->GetProperties( |
1417 dbus::ObjectPath(FakeBluetoothDeviceClient::kWeirdDevicePath)); | 1443 dbus::ObjectPath(FakeBluetoothDeviceClient::kWeirdDevicePath)); |
1418 EXPECT_TRUE(properties->trusted.value()); | 1444 EXPECT_TRUE(properties->trusted.value()); |
1419 } | 1445 } |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1839 EXPECT_FALSE(device->IsConnected()); | 1865 EXPECT_FALSE(device->IsConnected()); |
1840 EXPECT_FALSE(device->IsConnecting()); | 1866 EXPECT_FALSE(device->IsConnecting()); |
1841 EXPECT_FALSE(device->IsPaired()); | 1867 EXPECT_FALSE(device->IsPaired()); |
1842 | 1868 |
1843 // Pairing dialog should be dismissed | 1869 // Pairing dialog should be dismissed |
1844 EXPECT_EQ(1, pairing_delegate.call_count_); | 1870 EXPECT_EQ(1, pairing_delegate.call_count_); |
1845 EXPECT_EQ(1, pairing_delegate.dismiss_count_); | 1871 EXPECT_EQ(1, pairing_delegate.dismiss_count_); |
1846 } | 1872 } |
1847 | 1873 |
1848 } // namespace chromeos | 1874 } // namespace chromeos |
OLD | NEW |