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

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

Issue 1538173003: Implementing GATT connection/disconnect on OS X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip tests if Bluetooth Low Energy is not available Created 4 years, 9 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_central_manager_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_central_manager_mac.mm
diff --git a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
index 96e7ce9564303e3180cd52e75d1d9d9f8b149596..fbb0dff41e75d315a5044a6e61dde508fe7382fd 100644
--- a/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_central_manager_mac.mm
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#import "mock_bluetooth_central_manager_mac.h"
+#import "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
+
+#import "device/bluetooth/test/bluetooth_test_mac.h"
+#import "device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h"
@implementation MockCentralManager
@@ -10,6 +13,23 @@
@synthesize stopScanCallCount = _stopScanCallCount;
@synthesize delegate = _delegate;
@synthesize state = _state;
+@synthesize bluetoothTestMac = _bluetoothTestMac;
+
+- (BOOL)isKindOfClass:(Class)aClass {
+ if (aClass == [CBCentralManager class] ||
+ [aClass isSubclassOfClass:[CBCentralManager class]]) {
+ return YES;
+ }
+ return [super isKindOfClass:aClass];
+}
+
+- (BOOL)isMemberOfClass:(Class)aClass {
+ if (aClass == [CBCentralManager class] ||
+ [aClass isSubclassOfClass:[CBCentralManager class]]) {
+ return YES;
+ }
+ return [super isKindOfClass:aClass];
+}
- (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs
options:(NSDictionary*)options {
@@ -20,4 +40,17 @@
_stopScanCallCount++;
}
+- (void)connectPeripheral:(CBPeripheral*)peripheral
+ options:(NSDictionary*)options {
+ if (_bluetoothTestMac) {
+ _bluetoothTestMac->OnFakeBluetoothDeviceConnectGattCalled();
+ }
+}
+
+- (void)cancelPeripheralConnection:(CBPeripheral*)peripheral {
+ if (_bluetoothTestMac) {
+ _bluetoothTestMac->OnFakeBluetoothGattDisconnect();
+ }
+}
+
@end
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_central_manager_mac.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698