Index: device/bluetooth/test/bluetooth_test.h |
diff --git a/device/bluetooth/test/bluetooth_test.h b/device/bluetooth/test/bluetooth_test.h |
index 5e34d909d8666a6f1408a95cc4cb8ca38fc2de69..ad318e8366aa59af81dd8daeb8d8e8de2e153469 100644 |
--- a/device/bluetooth/test/bluetooth_test.h |
+++ b/device/bluetooth/test/bluetooth_test.h |
@@ -181,6 +181,41 @@ class BluetoothTestBase : public testing::Test { |
BluetoothGattCharacteristic* characteristic, |
const std::string& uuid) {} |
+ // Remembers |descriptor|'s platform specific object to be used in a |
+ // subsequent call to methods such as SimulateGattDescriptorRead that |
+ // accept a nullptr value to select this remembered descriptor. This |
+ // enables tests where the platform attempts to reference descriptor |
+ // objects after the Chrome objects have been deleted, e.g. with DeleteDevice. |
+ virtual void RememberDescriptorForSubsequentAction( |
+ BluetoothGattDescriptor* descriptor) {} |
+ |
+ // Simulates a Descriptor Read operation succeeding, returning |value|. |
+ // If |descriptor| is null, acts upon the descriptor provided to |
+ // RememberDescriptorForSubsequentAction. |
+ virtual void SimulateGattDescriptorRead(BluetoothGattDescriptor* descriptor, |
+ const std::vector<uint8_t>& value) {} |
+ |
+ // Simulates a Descriptor Read operation failing with a GattErrorCode. |
+ virtual void SimulateGattDescriptorReadError( |
+ BluetoothGattDescriptor* descriptor, |
+ BluetoothGattService::GattErrorCode) {} |
+ |
+ // Simulates a Descriptor Read operation failing synchronously once for an |
+ // unknown reason. |
+ virtual void SimulateGattDescriptorReadWillFailSynchronouslyOnce( |
+ BluetoothGattDescriptor* descriptor) {} |
+ |
+ // Simulates a Descriptor Write operation succeeding, returning |value|. |
+ // If |descriptor| is null, acts upon the descriptor provided to |
+ // RememberDescriptorForSubsequentAction. |
+ virtual void SimulateGattDescriptorWrite( |
+ BluetoothGattDescriptor* descriptor) {} |
+ |
+ // Simulates a Descriptor Write operation failing with a GattErrorCode. |
+ virtual void SimulateGattDescriptorWriteError( |
+ BluetoothGattDescriptor* descriptor, |
+ BluetoothGattService::GattErrorCode) {} |
+ |
// Simulates a Descriptor Write operation failing synchronously once for |
// an unknown reason. |
virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
@@ -242,6 +277,7 @@ class BluetoothTestBase : public testing::Test { |
int gatt_notify_characteristic_attempts_ = 0; |
int gatt_read_characteristic_attempts_ = 0; |
int gatt_write_characteristic_attempts_ = 0; |
+ int gatt_read_descriptor_attempts_ = 0; |
int gatt_write_descriptor_attempts_ = 0; |
// The following values are used to make sure the correct callbacks |