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..98f66f9454b65b12ea2b3a1824a6bc5106f8c9aa 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 as testing is concerned, and it's possible to write test |
+ // cases without using these functions. |
scheib
2015/05/28 23:09:16
Document how to use the method in tests with the c
ortuno
2015/05/29 17:53:55
Done.
|
+ 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 |