Chromium Code Reviews| 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 bc6349999cdd4b10d00f45b75bccd7ecc50850cf..aa361173cec438b2162cbb058cdbb44c98c47e65 100644 |
| --- a/device/bluetooth/bluetooth_adapter_mac_unittest.mm |
| +++ b/device/bluetooth/bluetooth_adapter_mac_unittest.mm |
| @@ -116,9 +116,11 @@ class BluetoothAdapterMacTest : public testing::Test { |
| LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; |
| return false; |
| } |
| - mock_central_manager_ = [[MockCentralManager alloc] init]; |
| + mock_central_manager_.reset([[MockCentralManager alloc] init]); |
| [mock_central_manager_ setState:desired_state]; |
| - adapter_mac_->SetCentralManagerForTesting(mock_central_manager_); |
| + CBCentralManager* centralManager = |
| + static_cast<CBCentralManager*>(mock_central_manager_.get()); |
|
msarda
2016/02/22 14:01:06
Do not use static_cast for Objective-C objects. Us
jlebel
2016/02/24 16:54:54
It is not possible, this is a mock.
|
| + adapter_mac_->SetCentralManagerForTesting(centralManager); |
| return true; |
| } |
| @@ -153,7 +155,7 @@ class BluetoothAdapterMacTest : public testing::Test { |
| BluetoothAdapterMac* adapter_mac_; |
| // Owned by |adapter_mac_|. |
| - id mock_central_manager_ = NULL; |
| + base::scoped_nsobject<MockCentralManager> mock_central_manager_; |
| int callback_count_; |
| int error_callback_count_; |