| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_cbcharacteristic_mac.h" | 5 #include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_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/bluetooth_gatt_characteristic.h" | 9 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 10 #include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h" | 10 #include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 CBPeripheral* peripheral = _service.peripheral; | 185 CBPeripheral* peripheral = _service.peripheral; |
| 186 [peripheral.delegate peripheral:peripheral | 186 [peripheral.delegate peripheral:peripheral |
| 187 didUpdateValueForCharacteristic:self.characteristic | 187 didUpdateValueForCharacteristic:self.characteristic |
| 188 error:nil]; | 188 error:nil]; |
| 189 } | 189 } |
| 190 | 190 |
| 191 - (void)addDescriptorWithUUID:(CBUUID*)uuid { | 191 - (void)addDescriptorWithUUID:(CBUUID*)uuid { |
| 192 scoped_nsobject<MockCBDescriptor> descriptor_mock([[MockCBDescriptor alloc] | 192 scoped_nsobject<MockCBDescriptor> descriptor_mock([[MockCBDescriptor alloc] |
| 193 initWithCharacteristic:self.characteristic | 193 initWithCharacteristic:self.characteristic |
| 194 CBUUID:uuid]); | 194 CBUUID:uuid]); |
| 195 [_descriptors.get() addObject:descriptor_mock]; | 195 [_descriptors addObject:descriptor_mock]; |
| 196 } | 196 } |
| 197 | 197 |
| 198 - (CBUUID*)UUID { | 198 - (CBUUID*)UUID { |
| 199 return _UUID.get(); | 199 return _UUID; |
| 200 } | 200 } |
| 201 | 201 |
| 202 - (CBCharacteristic*)characteristic { | 202 - (CBCharacteristic*)characteristic { |
| 203 return ObjCCast<CBCharacteristic>(self); | 203 return ObjCCast<CBCharacteristic>(self); |
| 204 } | 204 } |
| 205 | 205 |
| 206 - (CBService*)service { | 206 - (CBService*)service { |
| 207 return _service; | 207 return _service; |
| 208 } | 208 } |
| 209 | 209 |
| 210 - (CBCharacteristicProperties)properties { | 210 - (CBCharacteristicProperties)properties { |
| 211 return _cb_properties; | 211 return _cb_properties; |
| 212 } | 212 } |
| 213 | 213 |
| 214 - (NSArray*)descriptors { | 214 - (NSArray*)descriptors { |
| 215 return _descriptors; | 215 return _descriptors; |
| 216 } | 216 } |
| 217 | 217 |
| 218 - (id)value { | 218 - (id)value { |
| 219 return _value.get(); | 219 return _value; |
| 220 } | 220 } |
| 221 | 221 |
| 222 - (BOOL)isNotifying { | 222 - (BOOL)isNotifying { |
| 223 return _notifying; | 223 return _notifying; |
| 224 } | 224 } |
| 225 | 225 |
| 226 @end | 226 @end |
| OLD | NEW |