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 #ifndef DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ | 5 #ifndef DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ |
6 #define DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ | 6 #define DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ |
7 | 7 |
8 #include "base/mac/sdk_forward_declarations.h" | 8 #include "base/mac/sdk_forward_declarations.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
11 #if defined(OS_IOS) | 11 #if defined(OS_IOS) |
12 #import <CoreBluetooth/CoreBluetooth.h> | 12 #import <CoreBluetooth/CoreBluetooth.h> |
13 #else | 13 #else |
14 #import <IOBluetooth/IOBluetooth.h> | 14 #import <IOBluetooth/IOBluetooth.h> |
15 #endif | 15 #endif |
16 | 16 |
17 // Class to mock a CBCentralManager. Cannot use a OCMockObject because mocking | 17 // Class to mock a CBCentralManager. Cannot use a OCMockObject because mocking |
18 // the 'state' property gives a compiler warning when mock_central_manager is of | 18 // the 'state' property gives a compiler warning when mock_central_manager is of |
19 // type id (multiple methods named 'state' found), and a compiler warning when | 19 // type id (multiple methods named 'state' found), and a compiler warning when |
20 // mock_central_manager is of type CBCentralManager (CBCentralManager may not | 20 // mock_central_manager is of type CBCentralManager (CBCentralManager may not |
21 // respond to 'stub'). | 21 // respond to 'stub'). |
22 @interface MockCentralManager : NSObject | 22 @interface MockCentralManager : NSObject |
23 | 23 |
24 @property(nonatomic, assign) BOOL scanForPeripheralsCallCount; | 24 @property(nonatomic, assign) BOOL scanForPeripheralsCallCount; |
25 @property(nonatomic, assign) BOOL stopScanCallCount; | 25 @property(nonatomic, assign) BOOL stopScanCallCount; |
| 26 @property(nonatomic, assign) NSInteger connectPeripheralCallCount; |
26 @property(nonatomic, assign) id<CBCentralManagerDelegate> delegate; | 27 @property(nonatomic, assign) id<CBCentralManagerDelegate> delegate; |
27 @property(nonatomic, assign) CBCentralManagerState state; | 28 @property(nonatomic, assign) CBCentralManagerState state; |
28 | 29 |
29 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs | 30 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs |
30 options:(NSDictionary*)options; | 31 options:(NSDictionary*)options; |
31 | 32 |
32 - (void)stopScan; | 33 - (void)stopScan; |
33 | 34 |
| 35 - (void)connectPeripheral:(CBPeripheral*)peripheral |
| 36 options:(NSDictionary*)options; |
| 37 |
34 @end | 38 @end |
35 | 39 |
36 #endif // DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ | 40 #endif // DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_ |
OLD | NEW |