Index: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm |
diff --git a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ba0c8082310a01f5cf61a627c9359df871e7731d |
--- /dev/null |
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm |
@@ -0,0 +1,33 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import "mock_bluetooth_cbperipheral_mac.h" |
+ |
+@implementation MockCBPeripheral |
+ |
+@synthesize name = _name; |
+@synthesize identifier = _identifier; |
+@synthesize state = _state; |
+ |
+- (instancetype)initWithIdentifier:(NSUUID*)identifier { |
+ self = [super init]; |
+ if (self) { |
+ _identifier = [identifier retain]; |
+ _name = [@"FakeBluetoothDevice" retain]; |
+ _state = CBPeripheralStateDisconnected; |
+ } |
+ return self; |
+} |
+ |
+- (void)dealloc { |
+ [_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.
|
+ [_identifier release]; |
+ [super dealloc]; |
+} |
+ |
+- (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.
|
+ _state = state; |
+} |
+ |
+@end |