summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_adapter_mac.h
diff options
context:
space:
mode:
authorkrstnmnlsn <krstnmnlsn@chromium.org>2015-07-21 13:18:07 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-21 20:19:03 +0000
commit56d371034c68d9b21150b504138f2d4a2bb4a863 (patch)
tree666fd7e2b6a128106bc9b8b526df8ed7f7462180 /device/bluetooth/bluetooth_adapter_mac.h
parenteb3e372e3ac34f2d29dc5d544b2a4350d2cf775a (diff)
downloadchromium_src-56d371034c68d9b21150b504138f2d4a2bb4a863.zip
chromium_src-56d371034c68d9b21150b504138f2d4a2bb4a863.tar.gz
chromium_src-56d371034c68d9b21150b504138f2d4a2bb4a863.tar.bz2
Adding class BluetoothTestMac so that the ConstructDefaultAdapter,
ConstructWithoutDefaultAdapter, and ConstructFakeAdapter tests now pass on Mac as well as Android. BUG=511008 Review URL: https://codereview.chromium.org/1232613004 Cr-Commit-Position: refs/heads/master@{#339730}
Diffstat (limited to 'device/bluetooth/bluetooth_adapter_mac.h')
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/device/bluetooth/bluetooth_adapter_mac.h b/device/bluetooth/bluetooth_adapter_mac.h
index d85c9b1..2a5c119 100644
--- a/device/bluetooth/bluetooth_adapter_mac.h
+++ b/device/bluetooth/bluetooth_adapter_mac.h
@@ -41,7 +41,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
public BluetoothDiscoveryManagerMac::Observer,
public BluetoothLowEnergyDiscoveryManagerMac::Observer {
public:
- static base::WeakPtr<BluetoothAdapter> CreateAdapter();
+ static base::WeakPtr<BluetoothAdapterMac> CreateAdapter();
+ static base::WeakPtr<BluetoothAdapterMac> CreateAdapterForTest(
+ std::string name,
+ std::string address,
+ scoped_refptr<base::SequencedTaskRunner> ui_task_runner);
// BluetoothAdapter overrides:
std::string GetAddress() const override;
@@ -92,6 +96,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
// (crbug.com/506287).
static bool IsLowEnergyAvailable();
+ // Resets |low_energy_central_manager_| to |central_manager| and sets
+ // |low_energy_central_manager_delegate_| as the manager's delegate. Should
+ // be called only when |IsLowEnergyAvailable()|.
+ void SetCentralManagerForTesting(CBCentralManager* central_manager);
+
protected:
// BluetoothAdapter override:
void RemovePairingDelegateInternal(
@@ -148,15 +157,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterMac
// observers.
void AddPairedDevices();
- // Private method for testing. Resets |low_energy_central_manager_| to
- // |central_manager| and sets |low_energy_central_manager_delegate_| as its
- // delegate. Should be called only when CoreBluetooth is available.
- void SetCentralManagerForTesting(CBCentralManager* central_manager);
-
std::string address_;
std::string name_;
- bool powered_;
-
+ bool classic_powered_;
int num_discovery_sessions_;
// Discovery manager for Bluetooth Classic.