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 a11a11ba5ddcda7c04fd1e30664aa8673f009963..637ffee454fcbe6a996799fb5a9edb35bf0d8c49 100644 |
--- a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm |
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm |
@@ -83,11 +83,13 @@ using base::scoped_nsobject; |
if (_bluetoothTestMac) { |
_bluetoothTestMac->OnFakeBluetoothServiceDiscovery(); |
} |
- [_delegate peripheral:self.peripheral didDiscoverServices:nil]; |
} |
- (void)discoverCharacteristics:(NSArray*)characteristics |
forService:(CBService*)service { |
+ if (_bluetoothTestMac) { |
+ _bluetoothTestMac->OnFakeBluetoothCharacteristicDiscovery(); |
+ } |
} |
- (void)discoverDescriptorsForCharacteristic:(CBCharacteristic*)characteristic { |
@@ -139,8 +141,12 @@ using base::scoped_nsobject; |
[self didModifyServices:@[ serviceToRemove ]]; |
} |
-- (void)mockDidDiscoverEvents { |
+- (void)mockDidDiscoverServices { |
[_delegate peripheral:self.peripheral didDiscoverServices:nil]; |
+} |
+ |
+- (void)mockDidDiscoverEvents { |
+ [self mockDidDiscoverServices]; |
// BluetoothLowEnergyDeviceMac is expected to call |
// -[CBPeripheral discoverCharacteristics:forService:] for each services, |
// so -[<CBPeripheralDelegate peripheral:didDiscoverCharacteristicsForService: |