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

Side by Side Diff: device/bluetooth/test/bluetooth_test_win.h

Issue 1749403002: Implement BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust comments Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_ 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_
7 7
8 #include "device/bluetooth/test/bluetooth_test.h" 8 #include "device/bluetooth/test/bluetooth_test.h"
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 BluetoothTestWin(); 26 BluetoothTestWin();
27 ~BluetoothTestWin() override; 27 ~BluetoothTestWin() override;
28 28
29 // BluetoothTestBase overrides 29 // BluetoothTestBase overrides
30 bool PlatformSupportsLowEnergy() override; 30 bool PlatformSupportsLowEnergy() override;
31 void InitWithDefaultAdapter() override; 31 void InitWithDefaultAdapter() override;
32 void InitWithoutDefaultAdapter() override; 32 void InitWithoutDefaultAdapter() override;
33 void InitWithFakeAdapter() override; 33 void InitWithFakeAdapter() override;
34 bool DenyPermission() override; 34 bool DenyPermission() override;
35 void RunUntilIdle() override;
35 void StartLowEnergyDiscoverySession() override; 36 void StartLowEnergyDiscoverySession() override;
36 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override; 37 BluetoothDevice* DiscoverLowEnergyDevice(int device_ordinal) override;
37 void SimulateGattConnection(BluetoothDevice* device) override; 38 void SimulateGattConnection(BluetoothDevice* device) override;
38 void SimulateGattServicesDiscovered( 39 void SimulateGattServicesDiscovered(
39 BluetoothDevice* device, 40 BluetoothDevice* device,
40 const std::vector<std::string>& uuids) override; 41 const std::vector<std::string>& uuids) override;
41 void SimulateGattServiceRemoved(BluetoothGattService* service) override; 42 void SimulateGattServiceRemoved(BluetoothGattService* service) override;
42 void SimulateGattCharacteristic(BluetoothGattService* service, 43 void SimulateGattCharacteristic(BluetoothGattService* service,
43 const std::string& uuid, 44 const std::string& uuid,
44 int properties) override; 45 int properties) override;
45 void SimulateGattCharacteristicRemoved( 46 void SimulateGattCharacteristicRemoved(
46 BluetoothGattService* service, 47 BluetoothGattService* service,
47 BluetoothGattCharacteristic* characteristic) override; 48 BluetoothGattCharacteristic* characteristic) override;
48 void RememberCharacteristicForSubsequentAction( 49 void RememberCharacteristicForSubsequentAction(
49 BluetoothGattCharacteristic* characteristic) override; 50 BluetoothGattCharacteristic* characteristic) override;
50 void SimulateGattCharacteristicRead( 51 void SimulateGattCharacteristicRead(
51 BluetoothGattCharacteristic* characteristic, 52 BluetoothGattCharacteristic* characteristic,
52 const std::vector<uint8_t>& value) override; 53 const std::vector<uint8_t>& value) override;
53 void SimulateGattCharacteristicReadError( 54 void SimulateGattCharacteristicReadError(
54 BluetoothGattCharacteristic* characteristic, 55 BluetoothGattCharacteristic* characteristic,
55 BluetoothGattService::GattErrorCode error_code) override; 56 BluetoothGattService::GattErrorCode error_code) override;
56 void SimulateGattCharacteristicWrite( 57 void SimulateGattCharacteristicWrite(
57 BluetoothGattCharacteristic* characteristic) override; 58 BluetoothGattCharacteristic* characteristic) override;
58 void SimulateGattCharacteristicWriteError( 59 void SimulateGattCharacteristicWriteError(
59 BluetoothGattCharacteristic* characteristic, 60 BluetoothGattCharacteristic* characteristic,
60 BluetoothGattService::GattErrorCode error_code) override; 61 BluetoothGattService::GattErrorCode error_code) override;
62 virtual void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
63 BluetoothGattCharacteristic* characteristic) override;
61 void DeleteDevice(BluetoothDevice* device) override; 64 void DeleteDevice(BluetoothDevice* device) override;
62 void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic, 65 void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic,
63 const std::string& uuid) override; 66 const std::string& uuid) override;
67 void SimulateGattDescriptorWriteWillFailSynchronouslyOnce(
68 BluetoothGattDescriptor* descriptor) override;
69 void SimulateGattNotifySessionStarted(
70 BluetoothGattCharacteristic* characteristic) override;
71 void SimulateGattCharacteristicChanged(
72 BluetoothGattCharacteristic* characteristic,
73 const std::vector<uint8_t>& value) override;
64 74
65 // BluetoothTaskManagerWin::Observer overrides. 75 // BluetoothTaskManagerWin::Observer overrides.
66 void OnAttemptReadGattCharacteristic() override; 76 void OnAttemptReadGattCharacteristic() override;
67 void OnAttemptWriteGattCharacteristic() override; 77 void OnAttemptWriteGattCharacteristic() override;
68 78
69 // win::BluetoothLowEnergyWrapperFake::Observer overrides. 79 // win::BluetoothLowEnergyWrapperFake::Observer overrides.
70 void onWriteGattCharacteristicValue( 80 void OnWriteGattCharacteristicValue(
71 const PBTH_LE_GATT_CHARACTERISTIC_VALUE value) override; 81 const PBTH_LE_GATT_CHARACTERISTIC_VALUE value) override;
82 void OnWriteGattDescriptorValue(
83 const PBTH_LE_GATT_DESCRIPTOR_VALUE value) override;
84 void OnStartCharacteristicNotification() override;
72 85
73 private: 86 private:
74 scoped_refptr<base::TestSimpleTaskRunner> ui_task_runner_; 87 scoped_refptr<base::TestSimpleTaskRunner> ui_task_runner_;
75 scoped_refptr<base::TestSimpleTaskRunner> bluetooth_task_runner_; 88 scoped_refptr<base::TestSimpleTaskRunner> bluetooth_task_runner_;
76 BluetoothAdapterWin* adapter_win_; 89 BluetoothAdapterWin* adapter_win_;
77 90
78 win::BluetoothClassicWrapperFake* fake_bt_classic_wrapper_; 91 win::BluetoothClassicWrapperFake* fake_bt_classic_wrapper_;
79 win::BluetoothLowEnergyWrapperFake* fake_bt_le_wrapper_; 92 win::BluetoothLowEnergyWrapperFake* fake_bt_le_wrapper_;
80 93
81 BluetoothRemoteGattCharacteristicWin* remembered_characteristic_; 94 BluetoothRemoteGattCharacteristicWin* remembered_characteristic_;
(...skipping 10 matching lines...) Expand all
92 void ForceRefreshDevice(); 105 void ForceRefreshDevice();
93 void FinishPendingTasks(); 106 void FinishPendingTasks();
94 }; 107 };
95 108
96 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). 109 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName).
97 typedef BluetoothTestWin BluetoothTest; 110 typedef BluetoothTestWin BluetoothTest;
98 111
99 } // namespace device 112 } // namespace device
100 113
101 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_ 114 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698