| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 // Simulates a Characteristic Set Notify success. | 132 // Simulates a Characteristic Set Notify success. |
| 133 virtual void SimulateGattNotifySessionStarted( | 133 virtual void SimulateGattNotifySessionStarted( |
| 134 BluetoothGattCharacteristic* characteristic) {} | 134 BluetoothGattCharacteristic* characteristic) {} |
| 135 | 135 |
| 136 // Simulates a Characteristic Set Notify operation failing synchronously once | 136 // Simulates a Characteristic Set Notify operation failing synchronously once |
| 137 // for an unknown reason. | 137 // for an unknown reason. |
| 138 virtual void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( | 138 virtual void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( |
| 139 BluetoothGattCharacteristic* characteristic) {} | 139 BluetoothGattCharacteristic* characteristic) {} |
| 140 | 140 |
| 141 // Simulates a Characteristic Changed operation with updated |value|. |
| 142 virtual void SimulateGattCharacteristicChanged( |
| 143 BluetoothGattCharacteristic* characteristic, |
| 144 const std::vector<uint8_t>& value) {} |
| 145 |
| 141 // Simulates a Characteristic Read operation succeeding, returning |value|. | 146 // Simulates a Characteristic Read operation succeeding, returning |value|. |
| 142 // If |characteristic| is null, acts upon the characteristic provided to | 147 // If |characteristic| is null, acts upon the characteristic provided to |
| 143 // RememberCharacteristicForSubsequentAction. | 148 // RememberCharacteristicForSubsequentAction. |
| 144 virtual void SimulateGattCharacteristicRead( | 149 virtual void SimulateGattCharacteristicRead( |
| 145 BluetoothGattCharacteristic* characteristic, | 150 BluetoothGattCharacteristic* characteristic, |
| 146 const std::vector<uint8_t>& value) {} | 151 const std::vector<uint8_t>& value) {} |
| 147 | 152 |
| 148 // Simulates a Characteristic Read operation failing with a GattErrorCode. | 153 // Simulates a Characteristic Read operation failing with a GattErrorCode. |
| 149 virtual void SimulateGattCharacteristicReadError( | 154 virtual void SimulateGattCharacteristicReadError( |
| 150 BluetoothGattCharacteristic* characteristic, | 155 BluetoothGattCharacteristic* characteristic, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 int actual_error_callback_calls_ = 0; | 252 int actual_error_callback_calls_ = 0; |
| 248 bool unexpected_success_callback_ = false; | 253 bool unexpected_success_callback_ = false; |
| 249 bool unexpected_error_callback_ = false; | 254 bool unexpected_error_callback_ = false; |
| 250 | 255 |
| 251 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; | 256 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; |
| 252 }; | 257 }; |
| 253 | 258 |
| 254 } // namespace device | 259 } // namespace device |
| 255 | 260 |
| 256 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 261 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
| OLD | NEW |