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

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

Issue 1165053003: Adding support for Low Energy device discovery to BluetoothAdapterMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fixes Created 5 years, 6 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
Index: device/bluetooth/test/mock_bluetooth_central_manager_mac.h
diff --git a/device/bluetooth/test/mock_bluetooth_central_manager_mac.h b/device/bluetooth/test/mock_bluetooth_central_manager_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ffb6b09a7bd6340ee64e4f8d24fd8d27c7daaf6
--- /dev/null
+++ b/device/bluetooth/test/mock_bluetooth_central_manager_mac.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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.
+
+#ifndef DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_
+#define DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_
+
+#include "base/mac/sdk_forward_declarations.h"
+
+#if defined(OS_IOS)
+#import <CoreBluetooth/CoreBluetooth.h>
+#else
+#import <IOBluetooth/IOBluetooth.h>
+#endif
+
+// Class to mock a CBCentralManager. Cannot use a OCMockObject because mocking
+// the 'state' property gives a compiler warning when mock_central_manager is of
+// type id (multiple methods named 'state' found), and a compiler warning when
+// mock_central_manager is of type CBCentralManager (CBCentralManager may not
+// respond to 'stub').
+@interface MockCentralManager : NSObject
+
+@property(nonatomic, assign) BOOL scanForPeripheralsCallCount;
+@property(nonatomic, assign) BOOL stopScanCallCount;
+@property(nonatomic, assign) id<CBCentralManagerDelegate> delegate;
+
+// Designated initializer
+- (instancetype)init;
+
+- (instancetype)initWithDelegate:(id<CBCentralManagerDelegate>)delegate
+ queue:(dispatch_queue_t)queue
+ options:(NSDictionary*)options;
+
+- (CBCentralManagerState)state;
+
+- (void)scanForPeripheralsWithServices:(NSArray*)serviceUUIDs
+ options:(NSDictionary*)options;
+
+- (void)stopScan;
+
+@end
+
+#endif // DEVICE_BLUETOOTH_MOCK_BLUETOOTH_CENTRAL_MANAGER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698