Chromium Code Reviews| 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 ac87afe7c049881e628cb856fe9a5b5582b03119..a17a8bbc7fe67cb8a055c8e936055d6b3edbf837 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 { |
| @@ -160,6 +161,20 @@ class LayoutTestBluetoothAdapterProvider { |
| static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| GetGenericAccessAdapter(); |
|
scheib
2015/10/01 22:05:23
Changing test data should have corresponding test
ortuno
2015/10/03 04:03:04
There is an issue here: https://github.com/WebBlue
|
| + // |HeartRateAdapter| |
|
scheib
2015/10/01 22:05:23
Why not use GlucoseHeartRateAdapter? For a 'normal
ortuno
2015/10/03 04:03:04
This boils down to a design decision when refactor
scheib
2015/10/04 01:35:58
I mean, why not add this implementation to Glucose
ortuno
2015/10/06 02:38:43
Added a note to the bug http://crbug.com/529975. I
|
| + // 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 |
| @@ -310,7 +325,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) |
| @@ -391,6 +407,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: |
| @@ -400,6 +429,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, |