Chromium Code Reviews| 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 4a27f3be741b9b46614d225762a8a071b70e8f58..73527a2bbafe639696dab33a984c6f43d2ece5e2 100644 |
| --- a/device/bluetooth/test/bluetooth_test_mac.mm |
| +++ b/device/bluetooth/test/bluetooth_test_mac.mm |
| @@ -213,13 +213,13 @@ void BluetoothTestMac::SimulateGattDisconnection(BluetoothDevice* device) { |
| BluetoothLowEnergyDeviceMac* lowEnergyDeviceMac = |
| static_cast<BluetoothLowEnergyDeviceMac*>(device); |
| CBPeripheral* peripheral = lowEnergyDeviceMac->GetPeripheral(); |
| - MockCBPeripheral* mockPeripheral = (MockCBPeripheral*)peripheral; |
| - [mockPeripheral setState:CBPeripheralStateDisconnected]; |
| - CBCentralManager* centralManager = |
| + MockCBPeripheral* peripheral_mock = (MockCBPeripheral*)peripheral; |
| + [peripheral_mock setState:CBPeripheralStateDisconnected]; |
| + CBCentralManager* central_manager = |
| ObjCCast<CBCentralManager>(mock_central_manager_->get()); |
| - [centralManager.delegate centralManager:centralManager |
| - didDisconnectPeripheral:peripheral |
| - error:nil]; |
| + [central_manager.delegate centralManager:central_manager |
| + didDisconnectPeripheral:peripheral |
| + error:nil]; |
| } |
| void BluetoothTestMac::SimulateGattServicesDiscovered( |
| @@ -234,9 +234,8 @@ void BluetoothTestMac::SimulateGattServicesDiscovered( |
| CBUUID* cb_service_uuid = [CBUUID UUIDWithString:@(uuid.c_str())]; |
| [services addObject:cb_service_uuid]; |
| } |
| - [peripheral_mock removeAllServices]; |
| [peripheral_mock addServices:services]; |
| - [peripheral_mock didDiscoverWithError:nil]; |
| + [peripheral_mock didDiscoverServicesWithError:nil]; |
| } |
| void BluetoothTestMac::SimulateGattServiceRemoved( |
| @@ -251,7 +250,7 @@ void BluetoothTestMac::SimulateGattServiceRemoved( |
| CBPeripheral* peripheral = device_mac->GetPeripheral(); |
| MockCBPeripheral* peripheral_mock = ObjCCast<MockCBPeripheral>(peripheral); |
| [peripheral_mock removeService:mac_gatt_service->GetService()]; |
| - [peripheral_mock didDiscoverWithError:nil]; |
| + [peripheral_mock didDiscoverServicesWithError:nil]; |
|
ortuno
2016/06/03 00:05:10
This ends up calling didDiscoverServices which mea
jlebel
2016/06/03 00:23:19
After calling -[<CBPeripheralDelegate> peripheral:
ortuno
2016/06/03 01:07:56
Ah I see. Hmm the test seems bit fragile but no ne
|
| } |
| void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() { |