| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DEVICE_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ |
| 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ | 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 MOCK_CONST_METHOD0(GetBluetoothClass, uint32_t()); | 36 MOCK_CONST_METHOD0(GetBluetoothClass, uint32_t()); |
| 37 MOCK_CONST_METHOD0(GetType, BluetoothTransport()); | 37 MOCK_CONST_METHOD0(GetType, BluetoothTransport()); |
| 38 MOCK_CONST_METHOD0(GetIdentifier, std::string()); | 38 MOCK_CONST_METHOD0(GetIdentifier, std::string()); |
| 39 MOCK_CONST_METHOD0(GetAddress, std::string()); | 39 MOCK_CONST_METHOD0(GetAddress, std::string()); |
| 40 MOCK_CONST_METHOD0(GetVendorIDSource, BluetoothDevice::VendorIDSource()); | 40 MOCK_CONST_METHOD0(GetVendorIDSource, BluetoothDevice::VendorIDSource()); |
| 41 MOCK_CONST_METHOD0(GetVendorID, uint16_t()); | 41 MOCK_CONST_METHOD0(GetVendorID, uint16_t()); |
| 42 MOCK_CONST_METHOD0(GetProductID, uint16_t()); | 42 MOCK_CONST_METHOD0(GetProductID, uint16_t()); |
| 43 MOCK_CONST_METHOD0(GetDeviceID, uint16_t()); | 43 MOCK_CONST_METHOD0(GetDeviceID, uint16_t()); |
| 44 MOCK_CONST_METHOD0(GetAppearance, uint16_t()); | 44 MOCK_CONST_METHOD0(GetAppearance, uint16_t()); |
| 45 MOCK_CONST_METHOD0(GetName, base::Optional<std::string>()); |
| 45 MOCK_CONST_METHOD0(GetNameForDisplay, base::string16()); | 46 MOCK_CONST_METHOD0(GetNameForDisplay, base::string16()); |
| 46 MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType()); | 47 MOCK_CONST_METHOD0(GetDeviceType, BluetoothDevice::DeviceType()); |
| 47 MOCK_CONST_METHOD0(IsPaired, bool()); | 48 MOCK_CONST_METHOD0(IsPaired, bool()); |
| 48 MOCK_CONST_METHOD0(IsConnected, bool()); | 49 MOCK_CONST_METHOD0(IsConnected, bool()); |
| 49 MOCK_CONST_METHOD0(IsGattConnected, bool()); | 50 MOCK_CONST_METHOD0(IsGattConnected, bool()); |
| 50 MOCK_CONST_METHOD0(IsConnectable, bool()); | 51 MOCK_CONST_METHOD0(IsConnectable, bool()); |
| 51 MOCK_CONST_METHOD0(IsConnecting, bool()); | 52 MOCK_CONST_METHOD0(IsConnecting, bool()); |
| 52 MOCK_CONST_METHOD0(GetUUIDs, UUIDList()); | 53 MOCK_CONST_METHOD0(GetUUIDs, UUIDList()); |
| 53 MOCK_CONST_METHOD0(GetInquiryRSSI, int16_t()); | 54 MOCK_CONST_METHOD0(GetInquiryRSSI, int16_t()); |
| 54 MOCK_CONST_METHOD0(GetInquiryTxPower, int16_t()); | 55 MOCK_CONST_METHOD0(GetInquiryTxPower, int16_t()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void(const GattConnectionCallback& callback, | 90 void(const GattConnectionCallback& callback, |
| 90 const ConnectErrorCallback& error_callback)); | 91 const ConnectErrorCallback& error_callback)); |
| 91 | 92 |
| 92 MOCK_METHOD1(SetGattServicesDiscoveryComplete, void(bool)); | 93 MOCK_METHOD1(SetGattServicesDiscoveryComplete, void(bool)); |
| 93 MOCK_CONST_METHOD0(IsGattServicesDiscoveryComplete, bool()); | 94 MOCK_CONST_METHOD0(IsGattServicesDiscoveryComplete, bool()); |
| 94 | 95 |
| 95 MOCK_CONST_METHOD0(GetGattServices, | 96 MOCK_CONST_METHOD0(GetGattServices, |
| 96 std::vector<BluetoothRemoteGattService*>()); | 97 std::vector<BluetoothRemoteGattService*>()); |
| 97 MOCK_CONST_METHOD1(GetGattService, | 98 MOCK_CONST_METHOD1(GetGattService, |
| 98 BluetoothRemoteGattService*(const std::string&)); | 99 BluetoothRemoteGattService*(const std::string&)); |
| 99 MOCK_CONST_METHOD0(GetDeviceName, std::string()); | |
| 100 MOCK_METHOD0(CreateGattConnectionImpl, void()); | 100 MOCK_METHOD0(CreateGattConnectionImpl, void()); |
| 101 MOCK_METHOD0(DisconnectGatt, void()); | 101 MOCK_METHOD0(DisconnectGatt, void()); |
| 102 | 102 |
| 103 // BluetoothDevice manages the lifetime of its BluetoothGATTServices. | 103 // BluetoothDevice manages the lifetime of its BluetoothGATTServices. |
| 104 // This method takes ownership of the MockBluetoothGATTServices. This is only | 104 // This method takes ownership of the MockBluetoothGATTServices. This is only |
| 105 // for convenience as far as testing is concerned, and it's possible to write | 105 // for convenience as far as testing is concerned, and it's possible to write |
| 106 // test cases without using these functions. | 106 // test cases without using these functions. |
| 107 // Example: | 107 // Example: |
| 108 // ON_CALL(*mock_device, GetGattServices)) | 108 // ON_CALL(*mock_device, GetGattServices)) |
| 109 // .WillByDefault(Invoke(*mock_device, | 109 // .WillByDefault(Invoke(*mock_device, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 121 std::string address_; | 121 std::string address_; |
| 122 BluetoothDevice::UUIDList uuids_; | 122 BluetoothDevice::UUIDList uuids_; |
| 123 bool connected_; | 123 bool connected_; |
| 124 | 124 |
| 125 ScopedVector<MockBluetoothGattService> mock_services_; | 125 ScopedVector<MockBluetoothGattService> mock_services_; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } // namespace device | 128 } // namespace device |
| 129 | 129 |
| 130 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ | 130 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |