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

Unified Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Created 5 years, 3 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
Index: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
index 9d52de934c1d4b9ee2631142262174339c5b0ee4..e9d316daa3813978a4bacc2692bb5f42ea9a2047 100644
--- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
+++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h
@@ -10,6 +10,7 @@
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "device/bluetooth/test/mock_bluetooth_discovery_session.h"
#include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h"
+#include "device/bluetooth/test/mock_bluetooth_gatt_notify_session.h"
#include "device/bluetooth/test/mock_bluetooth_gatt_service.h"
namespace content {
@@ -151,6 +152,20 @@ class LayoutTestBluetoothAdapterProvider {
static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
GetGenericAccessAdapter();
+ // |HeartRateAdapter|
+ // Inherits from |EmptyAdapter|
+ // Internal Structure:
+ // - Heart Rate Device
+ // - Generic Access UUID (0x1800)
+ // - Heart Rate UUID (0x180D)
+ // - Heart Rate Service
+ // - Heart Rate Measurement Characteristic:
+ // - Mock Functions:
+ // - StartNotifySession: Calls success callback with a
+ // BaseGATTNotifySession(characteristic_instance_id)
+ static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
+ GetHeartRateAdapter();
+
// |FailingConnectionsAdapter|
// Inherits from |EmptyAdapter|
// FailingConnectionsAdapter holds a device for each type of connection error
@@ -289,7 +304,7 @@ class LayoutTestBluetoothAdapterProvider {
GetHeartRateDevice(device::MockBluetoothAdapter* adapter);
// |ConnectableDevice|
- // Inherits from |BaseDevice|(adapter, device_name)
+ // Inherits from |BaseDevice|(adapter, device_name, uuids, address)
// Adv UUIDs added:
// None.
// Services added:
@@ -301,7 +316,8 @@ class LayoutTestBluetoothAdapterProvider {
GetConnectableDevice(
device::MockBluetoothAdapter* adapter,
const std::string& device_name = "Connectable Device",
- device::BluetoothDevice::UUIDList = device::BluetoothDevice::UUIDList());
+ device::BluetoothDevice::UUIDList = device::BluetoothDevice::UUIDList(),
+ const std::string& address = "00:00:00:00:00:00");
// |UnconnectableDevice|
// Inherits from |BaseDevice|(adapter, device_name)
@@ -382,6 +398,19 @@ class LayoutTestBluetoothAdapterProvider {
GetBaseGATTCharacteristic(device::MockBluetoothGattService* service,
const std::string& uuid);
+ // Notify Sessions
+
+ // |BaseGATTNotifySession|(characteristic_identifier)
+ // Mock Functions:
+ // - GetCharacteristicIdentifier:
+ // Returns: characteristic_identifier
+ // - IsActive:
+ // Returns: true
+ // - Stop:
+ // Run callback.
+ static scoped_ptr<testing::NiceMock<device::MockBluetoothGattNotifySession>>
+ GetBaseGATTNotifySession(const std::string& characteristic_identifier);
+
// |ErrorCharacteristic|(service, error_type)
// Inherits from BaseCharacteristic(service, errorUUID(error_type + 0xA1))
// Descriptors added:
@@ -391,6 +420,8 @@ class LayoutTestBluetoothAdapterProvider {
// Run error callback with error_type
// - WriteRemoteCharacteristic:
// Run error callback with error_type
+ // - StartNotifySession:
+ // Run error callback with error_type
static scoped_ptr<testing::NiceMock<device::MockBluetoothGattCharacteristic>>
GetErrorCharacteristic(
device::MockBluetoothGattService* service,

Powered by Google App Engine
This is Rietveld 408576698