diff options
author | tommyt <tommyt@opera.com> | 2016-03-14 15:12:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-14 22:14:58 +0000 |
commit | 0348fa65c3d808f854f745fb9f8f185a5b74b922 (patch) | |
tree | a5dd2b2dc34bad55c18d974fb6d633ad13354493 /device/bluetooth/test/bluetooth_test_android.h | |
parent | 59d3539fc7ce60355ccf52c00733d33dde5e118a (diff) | |
download | chromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.zip chromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.tar.gz chromium_src-0348fa65c3d808f854f745fb9f8f185a5b74b922.tar.bz2 |
bluetooth: android: Confirm the notify session after the descriptor has been written.
This change also implements WriteRemoteDescriptor and
ReadRemoteDescriptor. Because of this, I've also added quite a few
descriptor unit tests. These tests are pretty much the same as the
read/write tests for characteristics.
BUG=584369
Review URL: https://codereview.chromium.org/1712593002
Cr-Commit-Position: refs/heads/master@{#381088}
Diffstat (limited to 'device/bluetooth/test/bluetooth_test_android.h')
-rw-r--r-- | device/bluetooth/test/bluetooth_test_android.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/device/bluetooth/test/bluetooth_test_android.h b/device/bluetooth/test/bluetooth_test_android.h index b855eca..8fbf61c 100644 --- a/device/bluetooth/test/bluetooth_test_android.h +++ b/device/bluetooth/test/bluetooth_test_android.h @@ -51,6 +51,7 @@ class BluetoothTestAndroid : public BluetoothTestBase { void SimulateGattCharacteristicChanged( BluetoothGattCharacteristic* characteristic, const std::vector<uint8_t>& value) override; + void SimulateGattCharacteristicRead( BluetoothGattCharacteristic* characteristic, const std::vector<uint8_t>& value) override; @@ -59,6 +60,7 @@ class BluetoothTestAndroid : public BluetoothTestBase { BluetoothGattService::GattErrorCode) override; void SimulateGattCharacteristicReadWillFailSynchronouslyOnce( BluetoothGattCharacteristic* characteristic) override; + void SimulateGattCharacteristicWrite( BluetoothGattCharacteristic* characteristic) override; void SimulateGattCharacteristicWriteError( @@ -66,8 +68,25 @@ class BluetoothTestAndroid : public BluetoothTestBase { BluetoothGattService::GattErrorCode) override; void SimulateGattCharacteristicWriteWillFailSynchronouslyOnce( BluetoothGattCharacteristic* characteristic) override; + void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic, const std::string& uuid) override; + void RememberDescriptorForSubsequentAction( + BluetoothGattDescriptor* descriptor) override; + + void SimulateGattDescriptorRead(BluetoothGattDescriptor* descriptor, + const std::vector<uint8_t>& value) override; + void SimulateGattDescriptorReadError( + BluetoothGattDescriptor* descriptor, + BluetoothGattService::GattErrorCode) override; + void SimulateGattDescriptorReadWillFailSynchronouslyOnce( + BluetoothGattDescriptor* descriptor) override; + + void SimulateGattDescriptorWrite( + BluetoothGattDescriptor* descriptor) override; + void SimulateGattDescriptorWriteError( + BluetoothGattDescriptor* descriptor, + BluetoothGattService::GattErrorCode) override; void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( BluetoothGattDescriptor* descriptor) override; @@ -112,6 +131,11 @@ class BluetoothTestAndroid : public BluetoothTestBase { const base::android::JavaParamRef<jobject>& caller, const base::android::JavaParamRef<jbyteArray>& value); + // Records that Java FakeBluetoothGatt readDescriptor was called. + void OnFakeBluetoothGattReadDescriptor( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& caller); + // Records that Java FakeBluetoothGatt writeDescriptor was called. void OnFakeBluetoothGattWriteDescriptor( JNIEnv* env, |