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

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

Issue 2253223002: bluetooth: Implement hardware filtering on macOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 4 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 #import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h" 5 #import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
6 6
7 #import "device/bluetooth/test/bluetooth_test_mac.h" 7 #import "device/bluetooth/test/bluetooth_test_mac.h"
8 #import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h" 8 #import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
9 9
10 @implementation MockCentralManager 10 @implementation MockCentralManager
(...skipping 15 matching lines...) Expand all
26 - (BOOL)isMemberOfClass:(Class)aClass { 26 - (BOOL)isMemberOfClass:(Class)aClass {
27 if (aClass == [CBCentralManager class] || 27 if (aClass == [CBCentralManager class] ||
28 [aClass isSubclassOfClass:[CBCentralManager class]]) { 28 [aClass isSubclassOfClass:[CBCentralManager class]]) {
29 return YES; 29 return YES;
30 } 30 }
31 return [super isKindOfClass:aClass]; 31 return [super isKindOfClass:aClass];
32 } 32 }
33 33
34 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs 34 - (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs
35 options:(NSDictionary*)options { 35 options:(NSDictionary*)options {
36 scan_uuids_.reset([serviceUUIDs retain]);
36 _scanForPeripheralsCallCount++; 37 _scanForPeripheralsCallCount++;
37 } 38 }
38 39
39 - (void)stopScan { 40 - (void)stopScan {
40 _stopScanCallCount++; 41 _stopScanCallCount++;
41 } 42 }
42 43
43 - (void)connectPeripheral:(CBPeripheral*)peripheral 44 - (void)connectPeripheral:(CBPeripheral*)peripheral
44 options:(NSDictionary*)options { 45 options:(NSDictionary*)options {
45 if (_bluetoothTestMac) { 46 if (_bluetoothTestMac) {
46 _bluetoothTestMac->OnFakeBluetoothDeviceConnectGattCalled(); 47 _bluetoothTestMac->OnFakeBluetoothDeviceConnectGattCalled();
47 } 48 }
48 } 49 }
49 50
50 - (void)cancelPeripheralConnection:(CBPeripheral*)peripheral { 51 - (void)cancelPeripheralConnection:(CBPeripheral*)peripheral {
51 if (_bluetoothTestMac) { 52 if (_bluetoothTestMac) {
52 _bluetoothTestMac->OnFakeBluetoothGattDisconnect(); 53 _bluetoothTestMac->OnFakeBluetoothGattDisconnect();
53 } 54 }
54 } 55 }
55 56
57 - (NSArray*)scan_uuids {
58 return scan_uuids_.get();
59 }
60
61 - (void)resetEventCounts {
62 _scanForPeripheralsCallCount = 0;
63 _stopScanCallCount = 0;
64 }
65
56 @end 66 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698