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

Unified Diff: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm

Issue 2638653002: Bluetooth: macOS: DidModifyServices can happens while scanning (Closed)
Patch Set: Removing useless modification Created 3 years, 8 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
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 637ffee454fcbe6a996799fb5a9edb35bf0d8c49..e4582926a5d1a6d46ebb1dc11188e1c1a2db93cd 100644
--- a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
@@ -145,6 +145,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
@@ -152,9 +165,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.

Powered by Google App Engine
This is Rietveld 408576698