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

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

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Fixing comments Created 4 years, 7 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbservice_mac.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
diff --git a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..9c372ff8ba286c6fac2a762f32b4685fd0221b94
--- /dev/null
+++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
@@ -0,0 +1,60 @@
+// Copyright 2016 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.
+
+#include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
+
+#include "base/mac/foundation_util.h"
+#include "base/mac/scoped_nsobject.h"
+#include "device/bluetooth/test/bluetooth_test.h"
+
+using base::mac::ObjCCast;
+using base::scoped_nsobject;
+
+@interface MockCBService () {
+ CBUUID* _UUID;
+ BOOL _primary;
+}
+
+@end
+
+@implementation MockCBService
+
+@synthesize UUID = _UUID;
+@synthesize isPrimary = _primary;
+
+- (instancetype)initWithCBUUID:(CBUUID*)uuid primary:(BOOL)isPrimary {
+ self = [super init];
+ if (self) {
+ _UUID = [uuid retain];
+ _primary = isPrimary;
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [_UUID release];
+ [super dealloc];
+}
+
+- (BOOL)isKindOfClass:(Class)aClass {
+ if (aClass == [CBService class] ||
+ [aClass isSubclassOfClass:[CBService class]]) {
+ return YES;
+ }
+ return [super isKindOfClass:aClass];
+}
+
+- (BOOL)isMemberOfClass:(Class)aClass {
+ if (aClass == [CBService class] ||
+ [aClass isSubclassOfClass:[CBService class]]) {
+ return YES;
+ }
+ return [super isKindOfClass:aClass];
+}
+
+- (CBService*)service {
+ return ObjCCast<CBService>(self);
+}
+
+@end
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbservice_mac.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698