| Index: device/bluetooth/test/mock_bluetooth_device.h
|
| diff --git a/device/bluetooth/test/mock_bluetooth_device.h b/device/bluetooth/test/mock_bluetooth_device.h
|
| index 039c8cec2b17e536ab5ef15e79c77bf720a826b5..2d16e46941e7e66f60955b7194ec29eb0f692a63 100644
|
| --- a/device/bluetooth/test/mock_bluetooth_device.h
|
| +++ b/device/bluetooth/test/mock_bluetooth_device.h
|
| @@ -7,13 +7,16 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/memory/scoped_vector.h"
|
| #include "base/strings/string16.h"
|
| #include "device/bluetooth/bluetooth_device.h"
|
| #include "device/bluetooth/bluetooth_uuid.h"
|
| +#include "device/bluetooth/test/mock_bluetooth_gatt_service.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
|
|
| namespace device {
|
|
|
| +class BluetoothGattService;
|
| class MockBluetoothAdapter;
|
|
|
| class MockBluetoothDevice : public BluetoothDevice {
|
| @@ -79,11 +82,24 @@ class MockBluetoothDevice : public BluetoothDevice {
|
| MOCK_CONST_METHOD0(GetGattServices, std::vector<BluetoothGattService*>());
|
| MOCK_CONST_METHOD1(GetGattService, BluetoothGattService*(const std::string&));
|
|
|
| + // BluetoothDevice manages the lifetime of its BluetoothGATTServices.
|
| + // This methods takes ownership of the BluetoothGATTServices. 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_device, GetGattServices))
|
| + // .WillByDefault(Invoke(*mock_device,
|
| + // &MockBluetoothDevice::GetMockServices));
|
| + void AddMockService(scoped_ptr<MockBluetoothGattService> mock_device);
|
| + std::vector<BluetoothGattService*> GetMockServices() const;
|
| +
|
| private:
|
| uint32 bluetooth_class_;
|
| std::string name_;
|
| std::string address_;
|
| BluetoothDevice::UUIDList uuids_;
|
| +
|
| + ScopedVector<MockBluetoothGattService> mock_services_;
|
| };
|
|
|
| } // namespace device
|
|
|