| 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 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 const std::string& uuid) {} | 190 const std::string& uuid) {} |
| 191 | 191 |
| 192 // Simulates a Descriptor Write operation failing synchronously once for | 192 // Simulates a Descriptor Write operation failing synchronously once for |
| 193 // an unknown reason. | 193 // an unknown reason. |
| 194 virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( | 194 virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
| 195 BluetoothGattDescriptor* descriptor) {} | 195 BluetoothGattDescriptor* descriptor) {} |
| 196 | 196 |
| 197 // Removes the device from the adapter and deletes it. | 197 // Removes the device from the adapter and deletes it. |
| 198 virtual void DeleteDevice(BluetoothDevice* device); | 198 virtual void DeleteDevice(BluetoothDevice* device); |
| 199 | 199 |
| 200 // Run all pending tasks until idle. |
| 201 virtual void RunUntilIdle(); |
| 202 |
| 200 // Callbacks that increment |callback_count_|, |error_callback_count_|: | 203 // Callbacks that increment |callback_count_|, |error_callback_count_|: |
| 201 void Callback(Call expected); | 204 void Callback(Call expected); |
| 202 void DiscoverySessionCallback(Call expected, | 205 void DiscoverySessionCallback(Call expected, |
| 203 scoped_ptr<BluetoothDiscoverySession>); | 206 scoped_ptr<BluetoothDiscoverySession>); |
| 204 void GattConnectionCallback(Call expected, | 207 void GattConnectionCallback(Call expected, |
| 205 scoped_ptr<BluetoothGattConnection>); | 208 scoped_ptr<BluetoothGattConnection>); |
| 206 void NotifyCallback(Call expected, scoped_ptr<BluetoothGattNotifySession>); | 209 void NotifyCallback(Call expected, scoped_ptr<BluetoothGattNotifySession>); |
| 207 void ReadValueCallback(Call expected, const std::vector<uint8_t>& value); | 210 void ReadValueCallback(Call expected, const std::vector<uint8_t>& value); |
| 208 void ErrorCallback(Call expected); | 211 void ErrorCallback(Call expected); |
| 209 void ConnectErrorCallback(Call expected, | 212 void ConnectErrorCallback(Call expected, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 int actual_error_callback_calls_ = 0; | 263 int actual_error_callback_calls_ = 0; |
| 261 bool unexpected_success_callback_ = false; | 264 bool unexpected_success_callback_ = false; |
| 262 bool unexpected_error_callback_ = false; | 265 bool unexpected_error_callback_ = false; |
| 263 | 266 |
| 264 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; | 267 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; |
| 265 }; | 268 }; |
| 266 | 269 |
| 267 } // namespace device | 270 } // namespace device |
| 268 | 271 |
| 269 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 272 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
| OLD | NEW |