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

Unified Diff: device/bluetooth/bluetooth_device_unittest.cc

Issue 1685963003: Adding the last test related with connect/disconnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connectdisconnect
Patch Set: Issue to convert no NSError to ConnectErrorCode Created 4 years, 10 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_device_unittest.cc
diff --git a/device/bluetooth/bluetooth_device_unittest.cc b/device/bluetooth/bluetooth_device_unittest.cc
index f3645c382f325285c8a73f351884e95dbfd6a117..b3002d211a3925a7e2fcda17671e5ff28d87ac43 100644
--- a/device/bluetooth/bluetooth_device_unittest.cc
+++ b/device/bluetooth/bluetooth_device_unittest.cc
@@ -443,7 +443,7 @@ TEST_F(BluetoothTest, BluetoothGattConnection_DisconnectGatt_Cleanup) {
}
#endif // defined(OS_ANDROID)
-#if defined(OS_ANDROID)
+#if defined(OS_ANDROID) || defined(OS_MACOSX)
// Calls CreateGattConnection, but simulate errors connecting. Also, verifies
// multiple errors should only invoke callbacks once.
TEST_F(BluetoothTest, BluetoothGattConnection_ErrorAfterConnection) {
@@ -457,15 +457,19 @@ TEST_F(BluetoothTest, BluetoothGattConnection_ErrorAfterConnection) {
EXPECT_EQ(1, gatt_connection_attempts_);
SimulateGattConnectionError(device, BluetoothDevice::ERROR_AUTH_FAILED);
SimulateGattConnectionError(device, BluetoothDevice::ERROR_FAILED);
+#if defined(OS_ANDROID)
// TODO: Change to ERROR_AUTH_FAILED. We should be getting a callback
// only with the first error, but our android framework doesn't yet
// support sending different errors.
// http://crbug.com/578191
EXPECT_EQ(BluetoothDevice::ERROR_FAILED, last_connect_error_code_);
+#else
+ EXPECT_EQ(BluetoothDevice::ERROR_AUTH_FAILED, last_connect_error_code_);
+#endif
for (BluetoothGattConnection* connection : gatt_connections_)
EXPECT_FALSE(connection->IsConnected());
}
-#endif // defined(OS_ANDROID)
+#endif // defined(OS_ANDROID) || defined(OS_MACOSX)
#if defined(OS_ANDROID)
TEST_F(BluetoothTest, GattServices_ObserversCalls) {

Powered by Google App Engine
This is Rietveld 408576698