| Index: device/bluetooth/test/mock_bluetooth_gatt_service.h
|
| diff --git a/device/bluetooth/test/mock_bluetooth_gatt_service.h b/device/bluetooth/test/mock_bluetooth_gatt_service.h
|
| index b03adfae16b6c22e65a3a948203add3eaee28661..b85e525967b15ff2e557d9fa0891045a263b3d7c 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_gatt_service.h
|
| +++ b/device/bluetooth/test/mock_bluetooth_gatt_service.h
|
| @@ -8,8 +8,10 @@
|
| #include <string>
|
| #include <vector>
|
|
|
| +#include "base/memory/scoped_vector.h"
|
| #include "device/bluetooth/bluetooth_gatt_service.h"
|
| #include "device/bluetooth/bluetooth_uuid.h"
|
| +#include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
|
|
| namespace device {
|
| @@ -41,7 +43,22 @@ class MockBluetoothGattService : public BluetoothGattService {
|
| MOCK_METHOD2(Register, void(const base::Closure&, const ErrorCallback&));
|
| MOCK_METHOD2(Unregister, void(const base::Closure&, const ErrorCallback&));
|
|
|
| + // BluetoothService manages the lifetime of its BluetoothGATTCharacteristics.
|
| + // This methods takes ownership of the BluetoothGATTCharacteristics. This is
|
| + // only for convenience as far as testing is concerned, and it's possible to
|
| + // write test cases without using these functions.
|
| + // Example:
|
| + // ON_CALL(*mock_service, GetCharacteristics))
|
| + // .WillByDefault(Invoke(
|
| + // *mock_service,
|
| + // &MockBluetoothGattService::GetMockCharacteristics));
|
| + void AddMockCharacteristic(
|
| + scoped_ptr<MockBluetoothGattCharacteristic> mock_characteristic);
|
| + std::vector<BluetoothGattCharacteristic*> GetMockCharacteristics() const;
|
| +
|
| private:
|
| + ScopedVector<MockBluetoothGattCharacteristic> mock_characteristics_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattService);
|
| };
|
|
|
|
|