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

Unified Diff: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm

Issue 1538173003: Implementing GATT connection/disconnect on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing the patch. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
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..0ca4a4641da617fe22536095b75d8efe30a16e45
--- /dev/null
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
@@ -0,0 +1,42 @@
+// 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"
+
+#include "base/mac/scoped_nsobject.h"
+
+@interface MockCBPeripheral () {
+ base::scoped_nsobject<NSUUID> _identifier;
+ base::scoped_nsobject<NSString> _name;
+}
+
+@end
+
+@implementation MockCBPeripheral
+
+@synthesize state = _state;
+
+- (instancetype)initWithIdentifier:(NSUUID*)identifier {
+ self = [super init];
+ if (self) {
+ _identifier.reset([identifier retain]);
+ _name.reset([@"FakeBluetoothDevice" retain]);
+ _state = CBPeripheralStateDisconnected;
+ }
+ return self;
+}
+
+- (void)setState:(CBPeripheralState)state {
+ _state = state;
+}
+
+- (NSUUID*)identifier {
+ return _identifier.get();
+}
+
+- (NSString*)name {
+ return _name.get();
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698