Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3422)

Unified Diff: device/bluetooth/test/bluetooth_test.h

Issue 1712593002: bluetooth: android: Confirm the notify session after the descriptor has been written. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Vincent's comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698