Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Fixing comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CBPERIPHERAL_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CBPERIPHERAL_MAC_H_
6 #define DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CBPERIPHERAL_MAC_H_ 6 #define DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CBPERIPHERAL_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 #import <CoreBluetooth/CoreBluetooth.h> 11 #import <CoreBluetooth/CoreBluetooth.h>
12 12
13 namespace device {
14
15 class BluetoothTestMac;
16 }
17
13 // This class mocks the behavior of a CBPeripheral. 18 // This class mocks the behavior of a CBPeripheral.
14 @interface MockCBPeripheral : NSObject 19 @interface MockCBPeripheral : NSObject
15 20
16 @property(nonatomic, readonly) CBPeripheralState state; 21 @property(nonatomic, readonly) CBPeripheralState state;
17 @property(nonatomic, readonly) NSUUID* identifier; 22 @property(nonatomic, readonly) NSUUID* identifier;
18 @property(nonatomic, readonly) NSString* name; 23 @property(nonatomic, readonly) NSString* name;
24 @property(nonatomic, assign) id<CBPeripheralDelegate> delegate;
19 @property(nonatomic, readonly) CBPeripheral* peripheral; 25 @property(nonatomic, readonly) CBPeripheral* peripheral;
26 @property(retain, readonly) NSArray* services;
27 @property(nonatomic, assign) device::BluetoothTestMac* bluetoothTestMac;
20 28
21 - (instancetype)init NS_UNAVAILABLE; 29 - (instancetype)init NS_UNAVAILABLE;
22 - (instancetype)initWithIdentifier:(NSUUID*)identifier; 30 - (instancetype)initWithIdentifier:(NSUUID*)identifier;
23 - (instancetype)initWithUTF8StringIdentifier:(const char*)identifier; 31 - (instancetype)initWithUTF8StringIdentifier:(const char*)identifier;
24 - (instancetype)initWithIdentifier:(NSUUID*)identifier 32 - (instancetype)initWithIdentifier:(NSUUID*)identifier
25 name:(NSString*)name NS_DESIGNATED_INITIALIZER; 33 name:(NSString*)name NS_DESIGNATED_INITIALIZER;
26 34
35 // Methods for faking events.
27 - (void)setState:(CBPeripheralState)state; 36 - (void)setState:(CBPeripheralState)state;
37 - (void)removeAllServices;
38 - (void)addServices:(NSArray*)services;
39 - (void)didDiscoverWithError:(NSError*)error;
40 - (void)removeService:(CBService*)uuid;
28 41
29 @end 42 @end
30 43
31 #endif // DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CBPERIPHERAL_MAC_H_ 44 #endif // DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CBPERIPHERAL_MAC_H_
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.mm ('k') | device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698