Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
|
ortuno
2016/05/06 16:03:35
nit: 2016
jlebel
2016/05/07 00:16:12
Done.
| |
| 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; | |
| 30 _primary = isPrimary; | |
| 31 } | |
| 32 return self; | |
| 33 } | |
| 34 | |
| 35 - (BOOL)isKindOfClass:(Class)aClass { | |
| 36 if (aClass == [CBService class] || | |
| 37 [aClass isSubclassOfClass:[CBService class]]) { | |
| 38 return YES; | |
| 39 } | |
| 40 return [super isKindOfClass:aClass]; | |
| 41 } | |
| 42 | |
| 43 - (BOOL)isMemberOfClass:(Class)aClass { | |
| 44 if (aClass == [CBService class] || | |
| 45 [aClass isSubclassOfClass:[CBService class]]) { | |
| 46 return YES; | |
| 47 } | |
| 48 return [super isKindOfClass:aClass]; | |
| 49 } | |
| 50 | |
| 51 - (CBService*)service { | |
| 52 return ObjCCast<CBService>(self); | |
| 53 } | |
| 54 | |
| 55 @end | |
| OLD | NEW |