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

Unified Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 1685963003: Adding the last test related with connect/disconnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connectdisconnect
Patch Set: adding DEVICE_BLUETOOTH_EXPORT to BluetoothDeviceMac Created 4 years, 9 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
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 78c9ee9264fc977ab9d9e0013d7800013feaf831..2622d60e4148914889a3a4a369ff858fe01f1d73 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -582,8 +582,12 @@ void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral,
}
VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
<< ", error code: " << error.code;
- // TODO(http://crbug.com/585894): Need to convert the error.
- device_mac->DidFailToConnectGatt(BluetoothClassicDeviceMac::ERROR_UNKNOWN);
+ BluetoothDevice::ConnectErrorCode error_code =
+ BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
+ VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code
+ << ", converted into: " << error_code;
+ device_mac->DidFailToConnectGatt(error_code);
}
void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral,
@@ -594,8 +598,11 @@ void BluetoothAdapterMac::DidDisconnectPeripheral(CBPeripheral* peripheral,
[low_energy_central_manager_ cancelPeripheralConnection:peripheral];
return;
}
- // TODO(http://crbug.com/585897): Need to pass the error.
- device_mac->DidDisconnectPeripheral();
+ VLOG(1) << "Bluetooth error, domain: " << error.domain.UTF8String
+ << ", error code: " << error.code;
+ BluetoothDevice::ConnectErrorCode error_code =
+ BluetoothDeviceMac::GetConnectErrorCodeFromNSError(error);
+ device_mac->DidDisconnectPeripheral(error_code);
}
BluetoothLowEnergyDeviceMac*
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698