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 #import "mock_bluetooth_cbperipheral_mac.h" |
| 8 |
7 @implementation MockCentralManager | 9 @implementation MockCentralManager |
8 | 10 |
9 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount; | 11 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount; |
10 @synthesize stopScanCallCount = _stopScanCallCount; | 12 @synthesize stopScanCallCount = _stopScanCallCount; |
11 @synthesize delegate = _delegate; | 13 @synthesize delegate = _delegate; |
12 @synthesize state = _state; | 14 @synthesize state = _state; |
| 15 @synthesize connectPeripheralCallCount = _connectPeripheralCallCount; |
13 | 16 |
14 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs | 17 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs |
15 options:(NSDictionary*)options { | 18 options:(NSDictionary*)options { |
16 _scanForPeripheralsCallCount++; | 19 _scanForPeripheralsCallCount++; |
17 } | 20 } |
18 | 21 |
19 - (void)stopScan { | 22 - (void)stopScan { |
20 _stopScanCallCount++; | 23 _stopScanCallCount++; |
21 } | 24 } |
22 | 25 |
| 26 - (void)connectPeripheral:(CBPeripheral*)peripheral |
| 27 options:(NSDictionary*)options { |
| 28 _connectPeripheralCallCount++; |
| 29 } |
| 30 |
| 31 - (void)cancelPeripheralConnection:(CBPeripheral*)peripheral { |
| 32 MockCBPeripheral* mockPeripheral = (MockCBPeripheral*)peripheral; |
| 33 [mockPeripheral setStateForTesting:CBPeripheralStateDisconnected]; |
| 34 } |
| 35 |
23 @end | 36 @end |
OLD | NEW |