| Index: device/bluetooth/test/mock_bluetooth_gatt_characteristic.cc
|
| diff --git a/device/bluetooth/test/mock_bluetooth_gatt_characteristic.cc b/device/bluetooth/test/mock_bluetooth_gatt_characteristic.cc
|
| index b2147d958144c4512e938b30708f788aa779212b..e6a979fb9ff44558ea3ac3a7061e5375a9d18cbc 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_gatt_characteristic.cc
|
| +++ b/device/bluetooth/test/mock_bluetooth_gatt_characteristic.cc
|
| @@ -3,7 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h"
|
| -
|
| +#include "device/bluetooth/test/mock_bluetooth_gatt_descriptor.h"
|
| #include "device/bluetooth/test/mock_bluetooth_gatt_service.h"
|
|
|
| using testing::Return;
|
| @@ -35,4 +35,29 @@ MockBluetoothGattCharacteristic::MockBluetoothGattCharacteristic(
|
| MockBluetoothGattCharacteristic::~MockBluetoothGattCharacteristic() {
|
| }
|
|
|
| +void MockBluetoothGattCharacteristic::AddMockDescriptor(
|
| + std::unique_ptr<MockBluetoothGattDescriptor> mock_descriptor) {
|
| + mock_descriptors_.push_back(std::move(mock_descriptor));
|
| +}
|
| +
|
| +std::vector<BluetoothRemoteGattDescriptor*>
|
| +MockBluetoothGattCharacteristic::GetMockDescriptors() const {
|
| + std::vector<BluetoothRemoteGattDescriptor*> descriptors;
|
| + for (BluetoothRemoteGattDescriptor* descriptor : mock_descriptors_) {
|
| + descriptors.push_back(descriptor);
|
| + }
|
| + return descriptors;
|
| +}
|
| +
|
| +BluetoothRemoteGattDescriptor*
|
| +MockBluetoothGattCharacteristic::GetMockDescriptor(
|
| + const std::string& identifier) const {
|
| + for (BluetoothRemoteGattDescriptor* descriptor : mock_descriptors_) {
|
| + if (descriptor->GetIdentifier() == identifier) {
|
| + return descriptor;
|
| + }
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| } // namespace device
|
|
|