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

Side by Side Diff: device/bluetooth/test/mock_bluetooth_central_manager_mac.mm

Issue 1538173003: Implementing GATT connection/disconnect on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip tests if Bluetooth Low Energy is not available Created 4 years, 9 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_central_manager_mac.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "mock_bluetooth_central_manager_mac.h" 5 #import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
6
7 #import "device/bluetooth/test/bluetooth_test_mac.h"
8 #import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
6 9
7 @implementation MockCentralManager 10 @implementation MockCentralManager
8 11
9 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount; 12 @synthesize scanForPeripheralsCallCount = _scanForPeripheralsCallCount;
10 @synthesize stopScanCallCount = _stopScanCallCount; 13 @synthesize stopScanCallCount = _stopScanCallCount;
11 @synthesize delegate = _delegate; 14 @synthesize delegate = _delegate;
12 @synthesize state = _state; 15 @synthesize state = _state;
16 @synthesize bluetoothTestMac = _bluetoothTestMac;
17
18 - (BOOL)isKindOfClass:(Class)aClass {
19 if (aClass == [CBCentralManager class] ||
20 [aClass isSubclassOfClass:[CBCentralManager class]]) {
21 return YES;
22 }
23 return [super isKindOfClass:aClass];
24 }
25
26 - (BOOL)isMemberOfClass:(Class)aClass {
27 if (aClass == [CBCentralManager class] ||
28 [aClass isSubclassOfClass:[CBCentralManager class]]) {
29 return YES;
30 }
31 return [super isKindOfClass:aClass];
32 }
13 33
14 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs 34 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs
15 options:(NSDictionary*)options { 35 options:(NSDictionary*)options {
16 _scanForPeripheralsCallCount++; 36 _scanForPeripheralsCallCount++;
17 } 37 }
18 38
19 - (void)stopScan { 39 - (void)stopScan {
20 _stopScanCallCount++; 40 _stopScanCallCount++;
21 } 41 }
22 42
43 - (void)connectPeripheral:(CBPeripheral*)peripheral
44 options:(NSDictionary*)options {
45 if (_bluetoothTestMac) {
46 _bluetoothTestMac->OnFakeBluetoothDeviceConnectGattCalled();
47 }
48 }
49
50 - (void)cancelPeripheralConnection:(CBPeripheral*)peripheral {
51 if (_bluetoothTestMac) {
52 _bluetoothTestMac->OnFakeBluetoothGattDisconnect();
53 }
54 }
55
23 @end 56 @end
OLDNEW
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_central_manager_mac.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698