| Index: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
|
| diff --git a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
|
| index f0a4a7338cf17210c78f7401ee488fe5b8baf81d..ef7667b2b1684932f2bf7e52f3fede950c3214f1 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
|
| +++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
|
| @@ -94,9 +94,6 @@ using base::scoped_nsobject;
|
| }
|
|
|
| - (void)discoverDescriptorsForCharacteristic:(CBCharacteristic*)characteristic {
|
| - MockCBCharacteristic* mock_characteristic =
|
| - ObjCCast<MockCBCharacteristic>(characteristic);
|
| - [mock_characteristic discoverDescriptors];
|
| }
|
|
|
| - (void)readValueForCharacteristic:(CBCharacteristic*)characteristic {
|
| @@ -158,6 +155,19 @@ using base::scoped_nsobject;
|
| [_delegate peripheral:self.peripheral didDiscoverServices:nil];
|
| }
|
|
|
| +- (void)mockDidDiscoverCharacteristicsForService:(CBService*)service {
|
| + [_delegate peripheral:self.peripheral
|
| + didDiscoverCharacteristicsForService:service
|
| + error:nil];
|
| +}
|
| +
|
| +- (void)mockDidDiscoverDescriptorsForCharacteristic:
|
| + (CBCharacteristic*)characteristic {
|
| + [_delegate peripheral:self.peripheral
|
| + didDiscoverDescriptorsForCharacteristic:characteristic
|
| + error:nil];
|
| +}
|
| +
|
| - (void)mockDidDiscoverEvents {
|
| [self mockDidDiscoverServices];
|
| // BluetoothLowEnergyDeviceMac is expected to call
|
| @@ -165,9 +175,7 @@ using base::scoped_nsobject;
|
| // so -[<CBPeripheralDelegate peripheral:didDiscoverCharacteristicsForService:
|
| // error:] needs to be called for all services.
|
| for (CBService* service in _services.get()) {
|
| - [_delegate peripheral:self.peripheral
|
| - didDiscoverCharacteristicsForService:service
|
| - error:nil];
|
| + [self mockDidDiscoverCharacteristicsForService:service];
|
| for (CBCharacteristic* characteristic in service.characteristics) {
|
| // After discovering services, BluetoothLowEnergyDeviceMac is expected to
|
| // discover characteristics for all services.
|
|
|