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

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

Issue 2767813002: Bluetooth: macOS: Implementing read/write for descriptors (Closed)
Patch Set: Adding NSError logs (and merge) Created 3 years, 9 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.h
diff --git a/device/bluetooth/test/bluetooth_test_mac.h b/device/bluetooth/test/bluetooth_test_mac.h
index 46e168a4d7c103432301130a05f5c1e113bd6085..70f1a4df405a0dc99fdeb25fbecf6bcb2fb8dc37 100644
--- a/device/bluetooth/test/bluetooth_test_mac.h
+++ b/device/bluetooth/test/bluetooth_test_mac.h
@@ -11,9 +11,11 @@
#include "device/bluetooth/test/bluetooth_test.h"
#if __OBJC__
+@class MockCBDescriptor;
@class MockCBCharacteristic;
@class MockCBPeripheral;
#else // __OBJC__
+class MockCBDescriptor;
class MockCBCharacteristic;
class MockCBPeripheral;
#endif // __OBJC__
@@ -85,6 +87,16 @@ class BluetoothTestMac : public BluetoothTestBase {
void SimulateGattCharacteristicRemoved(
BluetoothRemoteGattService* service,
BluetoothRemoteGattCharacteristic* characteristic) override;
+ void SimulateGattDescriptorRead(BluetoothRemoteGattDescriptor* descriptor,
+ const std::vector<uint8_t>& value) override;
+ void SimulateGattDescriptorReadError(
+ BluetoothRemoteGattDescriptor* descriptor,
+ BluetoothRemoteGattService::GattErrorCode error_code) override;
+ void SimulateGattDescriptorWrite(
+ BluetoothRemoteGattDescriptor* descriptor) override;
+ void SimulateGattDescriptorWriteError(
+ BluetoothRemoteGattDescriptor* descriptor,
+ BluetoothRemoteGattService::GattErrorCode error_code) override;
void ExpectedChangeNotifyValueAttempts(int attempts) override;
void ExpectedNotifyValue(NotifyValueState expected_value_state) override;
@@ -104,6 +116,8 @@ class BluetoothTestMac : public BluetoothTestBase {
void OnFakeBluetoothCharacteristicReadValue();
void OnFakeBluetoothCharacteristicWriteValue(std::vector<uint8_t> value);
void OnFakeBluetoothGattSetCharacteristicNotification(bool notify_value);
+ void OnFakeBluetoothDescriptorReadValue();
+ void OnFakeBluetoothDescriptorWriteValue(std::vector<uint8_t> value);
// Returns the service UUIDs used to retrieve connected peripherals.
BluetoothDevice::UUIDSet RetrieveConnectedPeripheralServiceUUIDs();
@@ -121,9 +135,15 @@ class BluetoothTestMac : public BluetoothTestBase {
// Returns MockCBPeripheral from BluetoothRemoteGattCharacteristic.
MockCBPeripheral* GetMockCBPeripheral(
BluetoothRemoteGattCharacteristic* characteristic) const;
+ // Returns MockCBPeripheral from BluetoothRemoteGattDescriptor.
+ MockCBPeripheral* GetMockCBPeripheral(
+ BluetoothRemoteGattDescriptor* descriptor) const;
// Returns MockCBCharacteristic from BluetoothRemoteGattCharacteristic.
MockCBCharacteristic* GetCBMockCharacteristic(
BluetoothRemoteGattCharacteristic* characteristic) const;
+ // Returns MockCBDescriptor from BluetoothRemoteGattDescriptor.
+ MockCBDescriptor* GetCBMockDescriptor(
+ BluetoothRemoteGattDescriptor* descriptor) const;
// Adds services in MockCBPeripheral.
void AddServicesToDevice(BluetoothDevice* device,
const std::vector<std::string>& uuids);

Powered by Google App Engine
This is Rietveld 408576698