OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "mock_bluetooth_central_manager_mac.h" | 5 #import "mock_bluetooth_central_manager_mac.h" |
6 | 6 |
7 @implementation MockCentralManager | 7 @implementation MockCentralManager |
8 | 8 |
9 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount; | 9 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount; |
10 @synthesize stopScanCallCount = _stopScanCallCount; | 10 @synthesize stopScanCallCount = _stopScanCallCount; |
11 @synthesize delegate = _delegate; | 11 @synthesize delegate = _delegate; |
| 12 @synthesize state = _state; |
12 | 13 |
13 - (instancetype)init { | 14 - (instancetype)init { |
14 _scanForPeripheralsCallCount = 0; | 15 _scanForPeripheralsCallCount = 0; |
15 _stopScanCallCount = 0; | 16 _stopScanCallCount = 0; |
16 return self; | 17 return self; |
17 } | 18 } |
18 | 19 |
19 - (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate | 20 - (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate |
20 queue:(dispatch_queue_t)queue | 21 queue:(dispatch_queue_t)queue |
21 options:(NSDictionary*)options { | 22 options:(NSDictionary*)options { |
22 return [self init]; | 23 return [self init]; |
23 } | 24 } |
24 | 25 |
25 - (CBCentralManagerState)state { | |
26 return CBCentralManagerStatePoweredOn; | |
27 } | |
28 | |
29 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs | 26 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs |
30 options:(NSDictionary*)options { | 27 options:(NSDictionary*)options { |
31 _scanForPeripheralsCallCount++; | 28 _scanForPeripheralsCallCount++; |
32 } | 29 } |
33 | 30 |
34 - (void)stopScan { | 31 - (void)stopScan { |
35 _stopScanCallCount++; | 32 _stopScanCallCount++; |
36 } | 33 } |
37 | 34 |
38 @end | 35 @end |
OLD | NEW |