| Index: device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
|
| diff --git a/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm b/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
|
| index be7a3f2cc43e1d0989006339dcda9cf0159c7af2..31816c79a50847c2823cdb052bcec3dafd48e39f 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
|
| +++ b/device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm
|
| @@ -7,6 +7,7 @@
|
| #include "base/mac/foundation_util.h"
|
| #include "base/mac/scoped_nsobject.h"
|
| #include "device/bluetooth/bluetooth_gatt_characteristic.h"
|
| +#include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h"
|
|
|
| using base::mac::ObjCCast;
|
| using base::scoped_nsobject;
|
| @@ -93,7 +94,9 @@ CBCharacteristicProperties GattCharacteristicPropertyToCBCharacteristicProperty(
|
| CBService* _service;
|
| scoped_nsobject<CBUUID> _UUID;
|
| CBCharacteristicProperties _cb_properties;
|
| - base::scoped_nsobject<NSData> _value;
|
| + scoped_nsobject<NSMutableArray> _simulatedDescriptors;
|
| + scoped_nsobject<NSArray> _descriptors;
|
| + scoped_nsobject<NSData> _value;
|
| BOOL _notifying;
|
| }
|
| @end
|
| @@ -110,6 +113,7 @@ CBCharacteristicProperties GattCharacteristicPropertyToCBCharacteristicProperty(
|
| _cb_properties =
|
| device::GattCharacteristicPropertyToCBCharacteristicProperty(
|
| properties);
|
| + _simulatedDescriptors.reset([[NSMutableArray alloc] init]);
|
| }
|
| return self;
|
| }
|
| @@ -168,6 +172,17 @@ CBCharacteristicProperties GattCharacteristicPropertyToCBCharacteristicProperty(
|
| error:nil];
|
| }
|
|
|
| +- (void)simulateDescriptorWithUUID:(CBUUID*)uuid {
|
| + scoped_nsobject<MockCBDescriptor> descriptor_mock([[MockCBDescriptor alloc]
|
| + initWithCharacteristic:self.characteristic
|
| + CBUUID:uuid]);
|
| + [_simulatedDescriptors.get() addObject:descriptor_mock];
|
| +}
|
| +
|
| +- (void)discoverDescriptors {
|
| + _descriptors.reset([_simulatedDescriptors copy]);
|
| +}
|
| +
|
| - (CBUUID*)UUID {
|
| return _UUID.get();
|
| }
|
| @@ -184,6 +199,10 @@ CBCharacteristicProperties GattCharacteristicPropertyToCBCharacteristicProperty(
|
| return _cb_properties;
|
| }
|
|
|
| +- (NSArray*)descriptors {
|
| + return _descriptors;
|
| +}
|
| +
|
| - (NSData*)value {
|
| return _value.get();
|
| }
|
| @@ -192,4 +211,4 @@ CBCharacteristicProperties GattCharacteristicPropertyToCBCharacteristicProperty(
|
| return _notifying;
|
| }
|
|
|
| -@end
|
| +@end
|
|
|