| Index: device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
|
| diff --git a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
|
| index fbb0dff41e75d315a5044a6e61dde508fe7382fd..12b4005406b5a5813b389a8cfbf6a2881f83f657 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
|
| +++ b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
|
| @@ -4,10 +4,15 @@
|
|
|
| #import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
|
|
|
| +#import "base/mac/scoped_nsobject.h"
|
| #import "device/bluetooth/test/bluetooth_test_mac.h"
|
| #import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
|
|
|
| -@implementation MockCentralManager
|
| +using base::scoped_nsobject;
|
| +
|
| +@implementation MockCentralManager {
|
| + scoped_nsobject<NSArray> _connectedMockPeripheral;
|
| +}
|
|
|
| @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount;
|
| @synthesize stopScanCallCount = _stopScanCallCount;
|
| @@ -15,6 +20,19 @@
|
| @synthesize state = _state;
|
| @synthesize bluetoothTestMac = _bluetoothTestMac;
|
|
|
| +- (instancetype)init {
|
| + self = [super init];
|
| + if (self) {
|
| + _connectedMockPeripheral.reset([[NSArray alloc] init]);
|
| + }
|
| + return self;
|
| +}
|
| +
|
| +- (void)dealloc {
|
| + [_connectedMockPeripheral release];
|
| + [super dealloc];
|
| +}
|
| +
|
| - (BOOL)isKindOfClass:(Class)aClass {
|
| if (aClass == [CBCentralManager class] ||
|
| [aClass isSubclassOfClass:[CBCentralManager class]]) {
|
| @@ -53,4 +71,12 @@
|
| }
|
| }
|
|
|
| +- (NSArray*)retrieveConnectedPeripheralsWithServices:(NSArray*)services {
|
| + return _connectedMockPeripheral.get();
|
| +}
|
| +
|
| +- (void)setConnectedMockPeripherals:(NSArray*)peripherals {
|
| + _connectedMockPeripheral.reset([peripherals copy]);
|
| +}
|
| +
|
| @end
|
|
|