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

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

Issue 2595373003: Bluetooth: mac: Working on macOS descriptor implementation. (Closed)
Patch Set: Fixes Created 3 years, 11 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/bluetooth_test_mac.mm
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
index 132c28a7350c60448409fa5b0eebb7a104dd2c8c..f0e3b882997d1385fb5915856ad35818a8e37705 100644
--- a/device/bluetooth/test/bluetooth_test_mac.mm
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -391,6 +391,20 @@ void BluetoothTestMac::SimulateGattCharacteristicWriteError(
[characteristic_mock simulateWriteWithError:error];
}
+void BluetoothTestMac::SimulateGattDescriptor(
+ BluetoothRemoteGattCharacteristic* characteristic,
+ const std::string& uuid) {
+ MockCBCharacteristic* characteristic_mock =
+ GetCBMockCharacteristic(characteristic);
+ CBUUID* cb_uuid = [CBUUID UUIDWithString:@(uuid.c_str())];
+ [characteristic_mock simulateDescriptorWithUUID:cb_uuid];
+ MockCBPeripheral* peripheral_mock = GetMockCBPeripheral(characteristic);
+ [peripheral_mock didModifyServices:@[]];
+ // After -[MockCBPeripheral didModifyServices:], BluetoothLowEnergyDeviceMac
+ // is expected to call -[CBPeripheral discoverServices:]
+ [peripheral_mock mockDidDiscoverEvents];
+}
+
void BluetoothTestMac::SimulateGattNotifySessionStarted(
BluetoothRemoteGattCharacteristic* characteristic) {
MockCBCharacteristic* characteristic_mock =
@@ -484,8 +498,13 @@ MockCBPeripheral* BluetoothTestMac::GetMockCBPeripheral(
return ObjCCast<MockCBPeripheral>(cb_peripheral);
}
+MockCBPeripheral* BluetoothTestMac::GetMockCBPeripheral(
+ BluetoothRemoteGattCharacteristic* characteristic) const {
+ return GetMockCBPeripheral(characteristic->GetService());
+}
+
MockCBCharacteristic* BluetoothTest::GetCBMockCharacteristic(
- device::BluetoothRemoteGattCharacteristic* characteristic) const {
+ BluetoothRemoteGattCharacteristic* characteristic) const {
device::BluetoothRemoteGattCharacteristicMac* mac_gatt_characteristic =
static_cast<device::BluetoothRemoteGattCharacteristicMac*>(
characteristic);
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.h ('k') | device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698