| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ | 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "device/bluetooth/bluetooth_gatt_service.h" | 11 #include "device/bluetooth/bluetooth_gatt_service.h" |
| 12 #include "device/bluetooth/bluetooth_uuid.h" | 12 #include "device/bluetooth/bluetooth_uuid.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 | 14 |
| 15 namespace device { | 15 namespace device { |
| 16 | 16 |
| 17 class BluetoothGattCharacteristic; | 17 class BluetoothGattCharacteristic; |
| 18 class MockBluetoothDevice; | 18 class MockBluetoothDevice; |
| 19 | 19 |
| 20 class MockBluetoothGattService : public BluetoothGattService { | 20 class MockBluetoothGattService : public BluetoothGattService { |
| 21 public: | 21 public: |
| 22 MockBluetoothGattService(MockBluetoothDevice* device, | 22 MockBluetoothGattService(MockBluetoothDevice* device, |
| 23 const std::string& identifier, | 23 const std::string& identifier, |
| 24 const BluetoothUUID& uuid, | 24 const BluetoothUUID& uuid, |
| 25 bool is_primary, | 25 bool is_primary, |
| 26 bool is_local); | 26 bool is_local); |
| 27 virtual ~MockBluetoothGattService(); | 27 virtual ~MockBluetoothGattService(); |
| 28 | 28 |
| 29 MOCK_METHOD1(AddObserver, void(BluetoothGattService::Observer*)); | |
| 30 MOCK_METHOD1(RemoveObserver, void(BluetoothGattService::Observer*)); | |
| 31 MOCK_CONST_METHOD0(GetIdentifier, std::string()); | 29 MOCK_CONST_METHOD0(GetIdentifier, std::string()); |
| 32 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID()); | 30 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID()); |
| 33 MOCK_CONST_METHOD0(IsLocal, bool()); | 31 MOCK_CONST_METHOD0(IsLocal, bool()); |
| 34 MOCK_CONST_METHOD0(IsPrimary, bool()); | 32 MOCK_CONST_METHOD0(IsPrimary, bool()); |
| 35 MOCK_CONST_METHOD0(GetDevice, BluetoothDevice*()); | 33 MOCK_CONST_METHOD0(GetDevice, BluetoothDevice*()); |
| 36 MOCK_CONST_METHOD0(GetCharacteristics, | 34 MOCK_CONST_METHOD0(GetCharacteristics, |
| 37 std::vector<BluetoothGattCharacteristic*>()); | 35 std::vector<BluetoothGattCharacteristic*>()); |
| 38 MOCK_CONST_METHOD0(GetIncludedServices, std::vector<BluetoothGattService*>()); | 36 MOCK_CONST_METHOD0(GetIncludedServices, std::vector<BluetoothGattService*>()); |
| 39 MOCK_CONST_METHOD1(GetCharacteristic, | 37 MOCK_CONST_METHOD1(GetCharacteristic, |
| 40 BluetoothGattCharacteristic*(const std::string&)); | 38 BluetoothGattCharacteristic*(const std::string&)); |
| 41 MOCK_METHOD1(AddCharacteristic, bool(BluetoothGattCharacteristic*)); | 39 MOCK_METHOD1(AddCharacteristic, bool(BluetoothGattCharacteristic*)); |
| 42 MOCK_METHOD1(AddIncludedService, bool(BluetoothGattService*)); | 40 MOCK_METHOD1(AddIncludedService, bool(BluetoothGattService*)); |
| 43 MOCK_METHOD2(Register, void(const base::Closure&, const ErrorCallback&)); | 41 MOCK_METHOD2(Register, void(const base::Closure&, const ErrorCallback&)); |
| 44 MOCK_METHOD2(Unregister, void(const base::Closure&, const ErrorCallback&)); | 42 MOCK_METHOD2(Unregister, void(const base::Closure&, const ErrorCallback&)); |
| 45 | 43 |
| 46 private: | 44 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattService); | 45 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattService); |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 } // namespace device | 48 } // namespace device |
| 51 | 49 |
| 52 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ | 50 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_SERVICE_H_ |
| OLD | NEW |