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

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

Issue 1920693002: Complete //device/bt implementation for hosting local GATT attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « device/bluetooth/test/bluetooth_gatt_server_test.cc ('k') | device/bluetooth/test/bluetooth_test_bluez.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/bluetooth_test.h
diff --git a/device/bluetooth/test/bluetooth_test.h b/device/bluetooth/test/bluetooth_test.h
index 51e6541f40c21555a8cc32177a321277dcd9199a..79c9c8b427c27da739d59e60dd0a0a85e5db97fd 100644
--- a/device/bluetooth/test/bluetooth_test.h
+++ b/device/bluetooth/test/bluetooth_test.h
@@ -8,6 +8,8 @@
#include <stdint.h>
#include <memory>
+#include <string>
+#include <vector>
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -71,16 +73,16 @@ class BluetoothTestBase : public testing::Test {
virtual bool PlatformSupportsLowEnergy() = 0;
// Initializes the BluetoothAdapter |adapter_| with the system adapter.
- virtual void InitWithDefaultAdapter(){};
+ virtual void InitWithDefaultAdapter() {}
// Initializes the BluetoothAdapter |adapter_| with the system adapter forced
// to be ignored as if it did not exist. This enables tests for when an
// adapter is not present on the system.
- virtual void InitWithoutDefaultAdapter(){};
+ virtual void InitWithoutDefaultAdapter() {}
// Initializes the BluetoothAdapter |adapter_| with a fake adapter that can be
// controlled by this test fixture.
- virtual void InitWithFakeAdapter(){};
+ virtual void InitWithFakeAdapter() {}
// Configures the fake adapter to lack the necessary permissions to scan for
// devices. Returns false if the current platform always has permission.
@@ -213,6 +215,42 @@ class BluetoothTestBase : public testing::Test {
BluetoothRemoteGattCharacteristic* characteristic,
const std::string& uuid) {}
+ // Simulates reading a value from a locally hosted GATT characteristic by a
+ // remote central device. Returns the value that was read from the local
+ // GATT characteristic in the value callback.
+ virtual void SimulateLocalGattCharacteristicValueReadRequest(
+ BluetoothLocalGattService* service,
+ BluetoothLocalGattCharacteristic* characteristic,
+ const BluetoothLocalGattService::Delegate::ValueCallback& value_callback,
+ const base::Closure& error_callback) {}
+
+ // Simulates write a value to a locally hosted GATT characteristic by a
+ // remote central device.
+ virtual void SimulateLocalGattCharacteristicValueWriteRequest(
+ BluetoothLocalGattService* service,
+ BluetoothLocalGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value_to_write,
+ const base::Closure& success_callback,
+ const base::Closure& error_callback) {}
+
+ // Simulates reading a value from a locally hosted GATT descriptor by a
+ // remote central device. Returns the value that was read from the local
+ // GATT descriptor in the value callback.
+ virtual void SimulateLocalGattDescriptorValueReadRequest(
+ BluetoothLocalGattService* service,
+ BluetoothLocalGattDescriptor* descriptor,
+ const BluetoothLocalGattService::Delegate::ValueCallback& value_callback,
+ const base::Closure& error_callback) {}
+
+ // Simulates write a value to a locally hosted GATT descriptor by a
+ // remote central device.
+ virtual void SimulateLocalGattDescriptorValueWriteRequest(
+ BluetoothLocalGattService* service,
+ BluetoothLocalGattDescriptor* descriptor,
+ const std::vector<uint8_t>& value_to_write,
+ const base::Closure& success_callback,
+ const base::Closure& error_callback) {}
+
// 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
« no previous file with comments | « device/bluetooth/test/bluetooth_gatt_server_test.cc ('k') | device/bluetooth/test/bluetooth_test_bluez.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698