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

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

Issue 1422463012: bluetooth: android: Implement StartNotifySession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed ortuno Created 5 years, 1 month 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 81de2b72dad36f99c5f1a6775d21fb6d4023c63a..c4f86873f1d111b2307d9499b7948350add04799 100644
--- a/device/bluetooth/test/bluetooth_test.h
+++ b/device/bluetooth/test/bluetooth_test.h
@@ -13,6 +13,7 @@
#include "device/bluetooth/bluetooth_discovery_session.h"
#include "device/bluetooth/bluetooth_gatt_characteristic.h"
#include "device/bluetooth/bluetooth_gatt_connection.h"
+#include "device/bluetooth/bluetooth_gatt_notify_session.h"
#include "device/bluetooth/bluetooth_gatt_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -101,6 +102,15 @@ class BluetoothTestBase : public testing::Test {
const std::string& uuid,
int properties) {}
+ // Simulates a Characteristic Set Notify success.
+ virtual void SimulateGattNotifySessionStarted(
+ BluetoothGattCharacteristic* characteristic) {}
+
+ // Simulates a Characteristic Set Notify operation failing synchronously once
+ // for an unknown reason.
+ virtual void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
+ BluetoothGattCharacteristic* characteristic) {}
+
// Simulates a Characteristic Read operation succeeding, returning |value|.
virtual void SimulateGattCharacteristicRead(
BluetoothGattCharacteristic* characteristic,
@@ -137,6 +147,7 @@ class BluetoothTestBase : public testing::Test {
void Callback();
void DiscoverySessionCallback(scoped_ptr<BluetoothDiscoverySession>);
void GattConnectionCallback(scoped_ptr<BluetoothGattConnection>);
+ void NotifyCallback(scoped_ptr<BluetoothGattNotifySession>);
void ReadValueCallback(const std::vector<uint8>& value);
void ErrorCallback();
void ConnectErrorCallback(enum BluetoothDevice::ConnectErrorCode);
@@ -146,6 +157,7 @@ class BluetoothTestBase : public testing::Test {
base::Closure GetCallback();
BluetoothAdapter::DiscoverySessionCallback GetDiscoverySessionCallback();
BluetoothDevice::GattConnectionCallback GetGattConnectionCallback();
+ BluetoothGattCharacteristic::NotifySessionCallback GetNotifyCallback();
BluetoothGattCharacteristic::ValueCallback GetReadValueCallback();
BluetoothAdapter::ErrorCallback GetErrorCallback();
BluetoothDevice::ConnectErrorCallback GetConnectErrorCallback();
@@ -164,6 +176,7 @@ class BluetoothTestBase : public testing::Test {
ScopedVector<BluetoothGattConnection> gatt_connections_;
enum BluetoothDevice::ConnectErrorCode last_connect_error_code_ =
BluetoothDevice::ERROR_UNKNOWN;
+ ScopedVector<BluetoothGattNotifySession> notify_sessions_;
std::vector<uint8> last_read_value_;
std::vector<uint8> last_write_value_;
BluetoothGattService::GattErrorCode last_gatt_error_code_;
@@ -172,6 +185,7 @@ class BluetoothTestBase : public testing::Test {
int gatt_connection_attempts_ = 0;
int gatt_disconnection_attempts_ = 0;
int gatt_discovery_attempts_ = 0;
+ int gatt_notify_characteristic_attempts_ = 0;
int gatt_read_characteristic_attempts_ = 0;
int gatt_write_characteristic_attempts_ = 0;
base::WeakPtrFactory<BluetoothTestBase> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698