| 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_DESCRIPTOR_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ | 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" |
| 13 #include "device/bluetooth/bluetooth_gatt_characteristic.h" | 15 #include "device/bluetooth/bluetooth_gatt_characteristic.h" |
| 14 #include "device/bluetooth/bluetooth_gatt_descriptor.h" | 16 #include "device/bluetooth/bluetooth_gatt_descriptor.h" |
| 15 #include "device/bluetooth/bluetooth_uuid.h" | 17 #include "device/bluetooth/bluetooth_uuid.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 17 | 19 |
| 18 namespace device { | 20 namespace device { |
| 19 | 21 |
| 20 class MockBluetoothGattCharacteristic; | 22 class MockBluetoothGattCharacteristic; |
| 21 | 23 |
| 22 class MockBluetoothGattDescriptor : public BluetoothGattDescriptor { | 24 class MockBluetoothGattDescriptor : public BluetoothGattDescriptor { |
| 23 public: | 25 public: |
| 24 MockBluetoothGattDescriptor( | 26 MockBluetoothGattDescriptor( |
| 25 MockBluetoothGattCharacteristic* characteristic, | 27 MockBluetoothGattCharacteristic* characteristic, |
| 26 const std::string& identifier, | 28 const std::string& identifier, |
| 27 const BluetoothUUID& uuid, | 29 const BluetoothUUID& uuid, |
| 28 bool is_local, | 30 bool is_local, |
| 29 BluetoothGattCharacteristic::Permissions permissions); | 31 BluetoothGattCharacteristic::Permissions permissions); |
| 30 virtual ~MockBluetoothGattDescriptor(); | 32 virtual ~MockBluetoothGattDescriptor(); |
| 31 | 33 |
| 32 MOCK_CONST_METHOD0(GetIdentifier, std::string()); | 34 MOCK_CONST_METHOD0(GetIdentifier, std::string()); |
| 33 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID()); | 35 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID()); |
| 34 MOCK_CONST_METHOD0(IsLocal, bool()); | 36 MOCK_CONST_METHOD0(IsLocal, bool()); |
| 35 MOCK_CONST_METHOD0(GetValue, const std::vector<uint8>&()); | 37 MOCK_CONST_METHOD0(GetValue, const std::vector<uint8_t>&()); |
| 36 MOCK_CONST_METHOD0(GetCharacteristic, BluetoothGattCharacteristic*()); | 38 MOCK_CONST_METHOD0(GetCharacteristic, BluetoothGattCharacteristic*()); |
| 37 MOCK_CONST_METHOD0(GetPermissions, | 39 MOCK_CONST_METHOD0(GetPermissions, |
| 38 BluetoothGattCharacteristic::Permissions()); | 40 BluetoothGattCharacteristic::Permissions()); |
| 39 MOCK_METHOD2(ReadRemoteDescriptor, | 41 MOCK_METHOD2(ReadRemoteDescriptor, |
| 40 void(const ValueCallback&, const ErrorCallback&)); | 42 void(const ValueCallback&, const ErrorCallback&)); |
| 41 MOCK_METHOD3(WriteRemoteDescriptor, | 43 MOCK_METHOD3(WriteRemoteDescriptor, |
| 42 void(const std::vector<uint8>&, | 44 void(const std::vector<uint8_t>&, |
| 43 const base::Closure&, | 45 const base::Closure&, |
| 44 const ErrorCallback&)); | 46 const ErrorCallback&)); |
| 45 | 47 |
| 46 private: | 48 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattDescriptor); | 49 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattDescriptor); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace device | 52 } // namespace device |
| 51 | 53 |
| 52 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ | 54 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ |
| OLD | NEW |