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

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

Issue 2638653002: Bluetooth: macOS: DidModifyServices can happens while scanning (Closed)
Patch Set: Merge Created 3 years, 7 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698