| 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 4e06976fdb7707782d6708ce8a7cdde01f75a3c8..48337c8e95a47e31605d4d70dc1e1dd502f15133 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
|
| +++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
|
| @@ -7,17 +7,13 @@
|
| #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;
|
|
|
| @interface MockCBService () {
|
| - // Owner of this instance.
|
| - CBPeripheral* _peripheral;
|
| scoped_nsobject<CBUUID> _UUID;
|
| BOOL _primary;
|
| - scoped_nsobject<NSMutableArray> _characteristics;
|
| }
|
|
|
| @end
|
| @@ -26,15 +22,11 @@
|
|
|
| @synthesize isPrimary = _primary;
|
|
|
| -- (instancetype)initWithPeripheral:(CBPeripheral*)peripheral
|
| - CBUUID:(CBUUID*)uuid
|
| - primary:(BOOL)isPrimary {
|
| +- (instancetype)initWithCBUUID:(CBUUID*)uuid primary:(BOOL)isPrimary {
|
| self = [super init];
|
| if (self) {
|
| _UUID.reset([uuid retain]);
|
| _primary = isPrimary;
|
| - _peripheral = peripheral;
|
| - _characteristics.reset([[NSMutableArray alloc] init]);
|
| }
|
| return self;
|
| }
|
| @@ -55,31 +47,12 @@
|
| return [super isKindOfClass:aClass];
|
| }
|
|
|
| -- (CBPeripheral*)peripheral {
|
| - return _peripheral;
|
| -}
|
| -
|
| - (CBUUID*)UUID {
|
| 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];
|
| -}
|
| -
|
| -- (void)removeCharacteristicMock:(MockCBCharacteristic*)characteristic_mock {
|
| - [_characteristics.get() removeObject:characteristic_mock];
|
| }
|
|
|
| - (CBService*)service {
|
| return ObjCCast<CBService>(self);
|
| }
|
|
|
| -- (NSArray*)characteristics {
|
| - return _characteristics.get();
|
| -}
|
| -
|
| @end
|
|
|