| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/test/bluetooth_test.h" | 5 #include "device/bluetooth/test/bluetooth_test.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 BluetoothDevice* BluetoothTestBase::DiscoverLowEnergyDevice( | 62 BluetoothDevice* BluetoothTestBase::DiscoverLowEnergyDevice( |
| 63 int device_ordinal) { | 63 int device_ordinal) { |
| 64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
| 65 return nullptr; | 65 return nullptr; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) { | 68 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) { |
| 69 adapter_->DeleteDeviceForTesting(device->GetAddress()); | 69 adapter_->DeleteDeviceForTesting(device->GetAddress()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void BluetoothTestBase::RunUntilIdle() { |
| 73 base::RunLoop().RunUntilIdle(); |
| 74 } |
| 75 |
| 72 void BluetoothTestBase::Callback(Call expected) { | 76 void BluetoothTestBase::Callback(Call expected) { |
| 73 ++callback_count_; | 77 ++callback_count_; |
| 74 | 78 |
| 75 if (expected == Call::EXPECTED) | 79 if (expected == Call::EXPECTED) |
| 76 ++actual_success_callback_calls_; | 80 ++actual_success_callback_calls_; |
| 77 else | 81 else |
| 78 unexpected_success_callback_ = true; | 82 unexpected_success_callback_ = true; |
| 79 } | 83 } |
| 80 | 84 |
| 81 void BluetoothTestBase::DiscoverySessionCallback( | 85 void BluetoothTestBase::DiscoverySessionCallback( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 gatt_connection_attempts_ = 0; | 232 gatt_connection_attempts_ = 0; |
| 229 gatt_disconnection_attempts_ = 0; | 233 gatt_disconnection_attempts_ = 0; |
| 230 gatt_discovery_attempts_ = 0; | 234 gatt_discovery_attempts_ = 0; |
| 231 gatt_notify_characteristic_attempts_ = 0; | 235 gatt_notify_characteristic_attempts_ = 0; |
| 232 gatt_read_characteristic_attempts_ = 0; | 236 gatt_read_characteristic_attempts_ = 0; |
| 233 gatt_write_characteristic_attempts_ = 0; | 237 gatt_write_characteristic_attempts_ = 0; |
| 234 gatt_write_descriptor_attempts_ = 0; | 238 gatt_write_descriptor_attempts_ = 0; |
| 235 } | 239 } |
| 236 | 240 |
| 237 } // namespace device | 241 } // namespace device |
| OLD | NEW |