summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_adapter_mac_unittest.mm
diff options
context:
space:
mode:
Diffstat (limited to 'device/bluetooth/bluetooth_adapter_mac_unittest.mm')
-rw-r--r--device/bluetooth/bluetooth_adapter_mac_unittest.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_adapter_mac_unittest.mm b/device/bluetooth/bluetooth_adapter_mac_unittest.mm
index 8cde99f..bc63499 100644
--- a/device/bluetooth/bluetooth_adapter_mac_unittest.mm
+++ b/device/bluetooth/bluetooth_adapter_mac_unittest.mm
@@ -251,6 +251,8 @@ TEST_F(BluetoothAdapterMacTest, RemoveDiscoverySessionWithLowEnergyFilterFail) {
}
TEST_F(BluetoothAdapterMacTest, CheckGetPeripheralHashAddress) {
+ if (!SetMockCentralManager(CBCentralManagerStatePoweredOn))
+ return;
base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID));
if (mock_peripheral.get() == nil)
return;
@@ -258,6 +260,8 @@ TEST_F(BluetoothAdapterMacTest, CheckGetPeripheralHashAddress) {
}
TEST_F(BluetoothAdapterMacTest, LowEnergyDeviceUpdatedNewDevice) {
+ if (!SetMockCentralManager(CBCentralManagerStatePoweredOn))
+ return;
base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID));
if (mock_peripheral.get() == nil)
return;
@@ -272,6 +276,8 @@ TEST_F(BluetoothAdapterMacTest, LowEnergyDeviceUpdatedNewDevice) {
}
TEST_F(BluetoothAdapterMacTest, LowEnergyDeviceUpdatedOldDevice) {
+ if (!SetMockCentralManager(CBCentralManagerStatePoweredOn))
+ return;
base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID));
if (mock_peripheral.get() == nil)
return;
@@ -302,6 +308,8 @@ TEST_F(BluetoothAdapterMacTest, LowEnergyDeviceUpdatedOldDevice) {
}
TEST_F(BluetoothAdapterMacTest, UpdateDevicesRemovesLowEnergyDevice) {
+ if (!SetMockCentralManager(CBCentralManagerStatePoweredOn))
+ return;
base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID));
if (mock_peripheral.get() == nil)
return;