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

Unified Diff: device/bluetooth/bluetooth_adapter_mac_unittest.mm

Issue 1645653003: Creating a CBCentralManager mock for all tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_adapter_mac_unittest.mm
diff --git a/device/bluetooth/bluetooth_adapter_mac_unittest.mm b/device/bluetooth/bluetooth_adapter_mac_unittest.mm
index 8cde99f64fcf31e595034254fdc675585e70984a..bc6349999cdd4b10d00f45b75bccd7ecc50850cf 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698