| Index: device/bluetooth/test/bluetooth_test_mac.mm
|
| diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
|
| index 8d0cf366671eb7fbf90f692356861bae5d6b97af..1df5a76cbc3e205f534cf766a7904dc47ad4b1c6 100644
|
| --- a/device/bluetooth/test/bluetooth_test_mac.mm
|
| +++ b/device/bluetooth/test/bluetooth_test_mac.mm
|
| @@ -202,7 +202,9 @@ void BluetoothTestMac::SimulateGattConnection(BluetoothDevice* device) {
|
| didConnectPeripheral:peripheral];
|
| }
|
|
|
| -void BluetoothTestMac::SimulateGattDisconnection(BluetoothDevice* device) {
|
| +void BluetoothTestMac::SimulateGattConnectionError(
|
| + BluetoothDevice* device,
|
| + BluetoothDevice::ConnectErrorCode errorCode) {
|
| BluetoothLowEnergyDeviceMac* lowEnergyDeviceMac =
|
| static_cast<BluetoothLowEnergyDeviceMac*>(device);
|
| CBPeripheral* peripheral = lowEnergyDeviceMac->GetPeripheral();
|
| @@ -210,14 +212,14 @@ void BluetoothTestMac::SimulateGattDisconnection(BluetoothDevice* device) {
|
| [mockPeripheral setState:CBPeripheralStateDisconnected];
|
| CBCentralManager* centralManager =
|
| static_cast<CBCentralManager*>(mock_central_manager_);
|
| + NSError* error =
|
| + BluetoothAdapterMac::GetNSErrorFromConnectErrorCode(errorCode);
|
| [centralManager.delegate centralManager:centralManager
|
| - didDisconnectPeripheral:peripheral
|
| - error:nil];
|
| + didFailToConnectPeripheral:peripheral
|
| + error:error];
|
| }
|
|
|
| -void BluetoothTestMac::SimulateGattConnectionError(
|
| - BluetoothDevice* device,
|
| - BluetoothDevice::ConnectErrorCode errorCode) {
|
| +void BluetoothTestMac::SimulateGattDisconnection(BluetoothDevice* device) {
|
| BluetoothLowEnergyDeviceMac* lowEnergyDeviceMac =
|
| static_cast<BluetoothLowEnergyDeviceMac*>(device);
|
| CBPeripheral* peripheral = lowEnergyDeviceMac->GetPeripheral();
|
| @@ -225,14 +227,9 @@ void BluetoothTestMac::SimulateGattConnectionError(
|
| [mockPeripheral setState:CBPeripheralStateDisconnected];
|
| CBCentralManager* centralManager =
|
| static_cast<CBCentralManager*>(mock_central_manager_);
|
| - // TODO(http://crbug.com/585894): Need to convert the connect error code into
|
| - // NSError
|
| - NSError* error = [NSError errorWithDomain:@"BluetoothDevice::ConnectErrorCode"
|
| - code:-1
|
| - userInfo:nil];
|
| [centralManager.delegate centralManager:centralManager
|
| - didFailToConnectPeripheral:peripheral
|
| - error:error];
|
| + didDisconnectPeripheral:peripheral
|
| + error:nil];
|
| }
|
|
|
| void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() {
|
|
|