| 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
|
|
|