Index: device/bluetooth/test/mock_bluetooth_cbservice_mac.mm |
diff --git a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm |
index 48337c8e95a47e31605d4d70dc1e1dd502f15133..a13be146fa69c1372dc87e53968f7d12fc41ec8f 100644 |
--- a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm |
+++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm |
@@ -7,6 +7,7 @@ |
#include "base/mac/foundation_util.h" |
#include "base/mac/scoped_nsobject.h" |
#include "device/bluetooth/test/bluetooth_test.h" |
+#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h" |
using base::mac::ObjCCast; |
using base::scoped_nsobject; |
@@ -14,6 +15,7 @@ using base::scoped_nsobject; |
@interface MockCBService () { |
scoped_nsobject<CBUUID> _UUID; |
BOOL _primary; |
+ scoped_nsobject<NSMutableArray> _characteristics; |
} |
@end |
@@ -27,6 +29,7 @@ using base::scoped_nsobject; |
if (self) { |
_UUID.reset([uuid retain]); |
_primary = isPrimary; |
+ _characteristics.reset([[NSMutableArray alloc] init]); |
} |
return self; |
} |
@@ -51,8 +54,19 @@ using base::scoped_nsobject; |
return _UUID.get(); |
} |
+- (void)addCharacteristicWithUUID:(CBUUID*)cb_uuid properties:(int)properties { |
+ scoped_nsobject<MockCBCharacteristic> characteristic_mock( |
+ [[MockCBCharacteristic alloc] initWithCBUUID:cb_uuid |
+ properties:properties]); |
+ [_characteristics.get() addObject:characteristic_mock]; |
+} |
+ |
- (CBService*)service { |
return ObjCCast<CBService>(self); |
} |
+- (NSArray*)characteristics { |
+ return _characteristics.get(); |
+} |
+ |
@end |