OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "mock_bluetooth_cbperipheral_mac.h" |
| 6 |
| 7 #include "base/mac/scoped_nsobject.h" |
| 8 |
| 9 @interface MockCBPeripheral () { |
| 10 base::scoped_nsobject<NSUUID> _identifier; |
| 11 base::scoped_nsobject<NSString> _name; |
| 12 } |
| 13 |
| 14 @end |
| 15 |
| 16 @implementation MockCBPeripheral |
| 17 |
| 18 @synthesize state = _state; |
| 19 |
| 20 - (instancetype)initWithIdentifier:(NSUUID*)identifier { |
| 21 self = [super init]; |
| 22 if (self) { |
| 23 _identifier.reset([identifier retain]); |
| 24 _name.reset([@"FakeBluetoothDevice" retain]); |
| 25 _state = CBPeripheralStateDisconnected; |
| 26 } |
| 27 return self; |
| 28 } |
| 29 |
| 30 - (void)setState:(CBPeripheralState)state { |
| 31 _state = state; |
| 32 } |
| 33 |
| 34 - (NSUUID*)identifier { |
| 35 return _identifier.get(); |
| 36 } |
| 37 |
| 38 - (NSString*)name { |
| 39 return _name.get(); |
| 40 } |
| 41 |
| 42 @end |
OLD | NEW |