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

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

Issue 2094633003: Bluetooth: Mac: implementation for start notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write_read_characteristicscan_servicescan_cleanup
Patch Set: Addressing msarda's comments Created 4 years, 6 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 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();
« 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