Chromium Code Reviews| 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..94869fcbf20bd7d067b7d34fa4807cfa237e31d9 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,20 @@ 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 testing is concerned and it's possible to write test |
|
Jeffrey Yasskin
2015/05/27 18:36:59
"…as far as…concerned, and it's…" or "…for conveni
ortuno
2015/05/27 21:07:46
Done.
|
| + // cases without using these functions. |
| + void AddMockService(scoped_ptr<MockBluetoothGattService> mock_device); |
| + std::vector<BluetoothGattService*> GetMockServices(); |
| + |
| private: |
| uint32 bluetooth_class_; |
| std::string name_; |
| std::string address_; |
| BluetoothDevice::UUIDList uuids_; |
| + |
| + ScopedVector<MockBluetoothGattService> mock_services_; |
| }; |
| } // namespace device |