Chromium Code Reviews| 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..b6b660abd18076b63001c0bd5f8701ea84390124 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,23 @@ class MockBluetoothGattService : public BluetoothGattService { |
| MOCK_METHOD2(Register, void(const base::Closure&, const ErrorCallback&)); |
| MOCK_METHOD2(Unregister, void(const base::Closure&, const ErrorCallback&)); |
| + // BluetoothGattService manages the lifetime of its |
| + // BluetoothGATTCharacteristics. |
| + // This methods takes ownership of the MockBluetoothGATTCharacteristics. This |
|
armansito
2015/06/09 19:23:49
nit: s/This methods/This method/
ortuno
2015/06/09 20:46:42
Done.
|
| + // 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( |
|
armansito
2015/06/09 19:23:49
Will you add similar methods to MockBluetoothGattC
ortuno
2015/06/09 20:46:42
Yes.
|
| + scoped_ptr<MockBluetoothGattCharacteristic> mock_characteristic); |
| + std::vector<BluetoothGattCharacteristic*> GetMockCharacteristics() const; |
| + |
| private: |
| + ScopedVector<MockBluetoothGattCharacteristic> mock_characteristics_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattService); |
| }; |