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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 #include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
6
7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_nsobject.h"
9 #include "device/bluetooth/test/bluetooth_test.h"
10
11 using base::mac::ObjCCast;
12 using base::scoped_nsobject;
13
14 @interface MockCBService () {
15 CBUUID* _UUID;
16 BOOL _primary;
17 }
18
19 @end
20
21 @implementation MockCBService
22
23 @synthesize UUID = _UUID;
24 @synthesize isPrimary = _primary;
25
26 - (instancetype)initWithCBUUID:(CBUUID*)uuid primary:(BOOL)isPrimary {
27 self = [super init];
28 if (self) {
29 _UUID = [uuid retain];
30 _primary = isPrimary;
31 }
32 return self;
33 }
34
35 - (void)dealloc {
36 [_UUID release];
37 [super dealloc];
38 }
39
40 - (BOOL)isKindOfClass:(Class)aClass {
41 if (aClass == [CBService class] ||
42 [aClass isSubclassOfClass:[CBService class]]) {
43 return YES;
44 }
45 return [super isKindOfClass:aClass];
46 }
47
48 - (BOOL)isMemberOfClass:(Class)aClass {
49 if (aClass == [CBService class] ||
50 [aClass isSubclassOfClass:[CBService class]]) {
51 return YES;
52 }
53 return [super isKindOfClass:aClass];
54 }
55
56 - (CBService*)service {
57 return ObjCCast<CBService>(self);
58 }
59
60 @end
OLDNEW
« 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