Chromium Code Reviews| 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 @implementation MockCBPeripheral | |
| 8 | |
| 9 @synthesize name = _name; | |
| 10 @synthesize identifier = _identifier; | |
| 11 @synthesize state = _state; | |
| 12 | |
| 13 - (instancetype)initWithIdentifier:(NSUUID*)identifier { | |
| 14 self = [super init]; | |
| 15 if (self) { | |
| 16 _identifier = [identifier retain]; | |
| 17 _name = [@"FakeBluetoothDevice" retain]; | |
| 18 _state = CBPeripheralStateDisconnected; | |
| 19 } | |
| 20 return self; | |
| 21 } | |
| 22 | |
| 23 - (void)dealloc { | |
| 24 [_name release]; | |
|
msarda
2016/02/11 10:55:39
Never call release. Use scoped_nsobject and implem
jlebel
2016/02/19 11:02:36
Done.
| |
| 25 [_identifier release]; | |
| 26 [super dealloc]; | |
| 27 } | |
| 28 | |
| 29 - (void)setStateForTesting:(CBPeripheralState)state { | |
|
msarda
2016/02/11 10:55:39
Optional: This is a mock object. It is not really
jlebel
2016/02/19 11:02:36
Done.
| |
| 30 _state = state; | |
| 31 } | |
| 32 | |
| 33 @end | |
| OLD | NEW |