Index: device/bluetooth/test/bluetooth_test_win.h |
diff --git a/device/bluetooth/test/bluetooth_test_win.h b/device/bluetooth/test/bluetooth_test_win.h |
index d87baccf31f7cb4ac760c7cc87a71125fc278b80..b989fabeb5353c3deb83aa3868469a8c7b78ed6a 100644 |
--- a/device/bluetooth/test/bluetooth_test_win.h |
+++ b/device/bluetooth/test/bluetooth_test_win.h |
@@ -12,12 +12,16 @@ |
#include "base/test/test_simple_task_runner.h" |
#include "device/bluetooth/bluetooth_classic_win_fake.h" |
#include "device/bluetooth/bluetooth_low_energy_win_fake.h" |
+#include "device/bluetooth/bluetooth_task_manager_win.h" |
namespace device { |
class BluetoothAdapterWin; |
+class BluetoothRemoteGattCharacteristicWin; |
// Windows implementation of BluetoothTestBase. |
-class BluetoothTestWin : public BluetoothTestBase { |
+class BluetoothTestWin : public BluetoothTestBase, |
+ public BluetoothTaskManagerWin::Observer, |
+ public win::BluetoothLowEnergyWrapperFake::Observer { |
public: |
BluetoothTestWin(); |
~BluetoothTestWin() override; |
@@ -41,9 +45,31 @@ class BluetoothTestWin : public BluetoothTestBase { |
void SimulateGattCharacteristicRemoved( |
BluetoothGattService* service, |
BluetoothGattCharacteristic* characteristic) override; |
+ void RememberCharacteristicForSubsequentAction( |
+ BluetoothGattCharacteristic* characteristic) override; |
+ void SimulateGattCharacteristicRead( |
+ BluetoothGattCharacteristic* characteristic, |
+ const std::vector<uint8_t>& value) override; |
+ void SimulateGattCharacteristicReadError( |
+ BluetoothGattCharacteristic* characteristic, |
+ BluetoothGattService::GattErrorCode error_code) override; |
+ void SimulateGattCharacteristicWrite( |
+ BluetoothGattCharacteristic* characteristic) override; |
+ void SimulateGattCharacteristicWriteError( |
+ BluetoothGattCharacteristic* characteristic, |
+ BluetoothGattService::GattErrorCode error_code) override; |
+ void DeleteDevice(BluetoothDevice* device) override; |
void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic, |
const std::string& uuid) override; |
+ // BluetoothTaskManagerWin::Observer overrides. |
+ void OnAttemptReadGattCharacteristic() override; |
+ void OnAttemptWriteGattCharacteristic() override; |
+ |
+ // win::BluetoothLowEnergyWrapperFake::Observer overrides. |
+ void onWriteGattCharacteristicValue( |
+ const PBTH_LE_GATT_CHARACTERISTIC_VALUE value) override; |
+ |
private: |
scoped_refptr<base::TestSimpleTaskRunner> ui_task_runner_; |
scoped_refptr<base::TestSimpleTaskRunner> bluetooth_task_runner_; |
@@ -52,11 +78,14 @@ class BluetoothTestWin : public BluetoothTestBase { |
win::BluetoothClassicWrapperFake* fake_bt_classic_wrapper_; |
win::BluetoothLowEnergyWrapperFake* fake_bt_le_wrapper_; |
+ BluetoothRemoteGattCharacteristicWin* remembered_characteristic_; |
+ |
void AdapterInitCallback(); |
win::GattService* GetSimulatedService(win::BLEDevice* device, |
BluetoothGattService* service); |
win::GattCharacteristic* GetSimulatedCharacteristic( |
BluetoothGattCharacteristic* characteristic); |
+ void ExecutePendingBluetoothTasksUntil(std::string function); |
void ForceRefreshDevice(); |
void FinishPendingTasks(); |
}; |