| 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 048810664eb089ec0a48671f8a9bd36691a6a904..27717f2a8178cca99ec74aa8cdec7965447d7b61 100644
|
| --- a/device/bluetooth/test/bluetooth_test_mac.mm
|
| +++ b/device/bluetooth/test/bluetooth_test_mac.mm
|
| @@ -325,6 +325,32 @@ void BluetoothTestMac::SimulateGattCharacteristicWriteError(
|
| [characteristic_mock simulateWriteWithError:error];
|
| }
|
|
|
| +void BluetoothTestMac::SimulateGattNotifySessionStarted(
|
| + BluetoothRemoteGattCharacteristic* characteristic) {
|
| + MockCBCharacteristic* characteristic_mock =
|
| + GetCBMockCharacteristic(characteristic);
|
| + [characteristic_mock simulateGattNotifySessionStarted];
|
| +}
|
| +
|
| +void BluetoothTestMac::SimulateGattNotifySessionStartError(
|
| + BluetoothRemoteGattCharacteristic* characteristic,
|
| + BluetoothRemoteGattService::GattErrorCode error_code) {
|
| + MockCBCharacteristic* characteristic_mock =
|
| + GetCBMockCharacteristic(characteristic);
|
| + NSError* error = BluetoothDeviceMac::GetNSErrorFromGattErrorCode(error_code);
|
| + [characteristic_mock simulateGattNotifySessionFailedWithError:error];
|
| +}
|
| +
|
| +void BluetoothTestMac::SimulateGattCharacteristicChanged(
|
| + BluetoothRemoteGattCharacteristic* characteristic,
|
| + const std::vector<uint8_t>& value) {
|
| + MockCBCharacteristic* characteristic_mock =
|
| + GetCBMockCharacteristic(characteristic);
|
| + scoped_nsobject<NSData> data(
|
| + [[NSData alloc] initWithBytes:value.data() length:value.size()]);
|
| + [characteristic_mock simulateGattCharacteristicChangedWithValue:data];
|
| +}
|
| +
|
| void BluetoothTestMac::SimulateGattCharacteristicRemoved(
|
| BluetoothRemoteGattService* service,
|
| BluetoothRemoteGattCharacteristic* characteristic) {
|
| @@ -365,6 +391,10 @@ void BluetoothTest::OnFakeBluetoothCharacteristicWriteValue(
|
| gatt_write_characteristic_attempts_++;
|
| }
|
|
|
| +void BluetoothTest::OnFakeBluetoothGattSetCharacteristicNotification() {
|
| + gatt_notify_characteristic_attempts_++;
|
| +}
|
| +
|
| MockCBPeripheral* BluetoothTestMac::GetMockCBPeripheral(
|
| BluetoothRemoteGattService* service) const {
|
| BluetoothDevice* device = service->GetDevice();
|
|
|