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

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

Issue 2052513002: Read characteristic implementation on macOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@characteristicscan_servicescan_cleanup
Patch Set: Addressing msarda's comment Created 4 years, 5 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 #include "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h" 5 #include "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "device/bluetooth/test/bluetooth_test_mac.h" 9 #include "device/bluetooth/test/bluetooth_test_mac.h"
10 #include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h" 10 #include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (_bluetoothTestMac) { 84 if (_bluetoothTestMac) {
85 _bluetoothTestMac->OnFakeBluetoothServiceDiscovery(); 85 _bluetoothTestMac->OnFakeBluetoothServiceDiscovery();
86 } 86 }
87 [_delegate peripheral:self.peripheral didDiscoverServices:nil]; 87 [_delegate peripheral:self.peripheral didDiscoverServices:nil];
88 } 88 }
89 89
90 - (void)discoverCharacteristics:(NSArray*)characteristics 90 - (void)discoverCharacteristics:(NSArray*)characteristics
91 forService:(CBService*)service { 91 forService:(CBService*)service {
92 } 92 }
93 93
94 - (void)readValueForCharacteristic:(CBCharacteristic*)characteristic {
95 DCHECK(_bluetoothTestMac);
96 _bluetoothTestMac->OnFakeBluetoothCharacteristicReadValue();
97 }
98
94 - (void)removeAllServices { 99 - (void)removeAllServices {
95 [_services.get() removeAllObjects]; 100 [_services.get() removeAllObjects];
96 } 101 }
97 102
98 - (void)addServices:(NSArray*)services { 103 - (void)addServices:(NSArray*)services {
99 if (!_services.get()) { 104 if (!_services.get()) {
100 _services.reset([[NSMutableArray alloc] init]); 105 _services.reset([[NSMutableArray alloc] init]);
101 } 106 }
102 for (CBUUID* uuid in services) { 107 for (CBUUID* uuid in services) {
103 base::scoped_nsobject<MockCBService> service([[MockCBService alloc] 108 base::scoped_nsobject<MockCBService> service([[MockCBService alloc]
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 155
151 - (NSArray*)services { 156 - (NSArray*)services {
152 return _services.get(); 157 return _services.get();
153 } 158 }
154 159
155 - (CBPeripheral*)peripheral { 160 - (CBPeripheral*)peripheral {
156 return ObjCCast<CBPeripheral>(self); 161 return ObjCCast<CBPeripheral>(self);
157 } 162 }
158 163
159 @end 164 @end
OLDNEW
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm ('k') | device/bluetooth/test/mock_bluetooth_cbservice_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698