| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // test cases without using these functions. | 107 // test cases without using these functions. |
| 108 // Example: | 108 // Example: |
| 109 // ON_CALL(*mock_device, GetGattServices)) | 109 // ON_CALL(*mock_device, GetGattServices)) |
| 110 // .WillByDefault(Invoke(*mock_device, | 110 // .WillByDefault(Invoke(*mock_device, |
| 111 // &MockBluetoothDevice::GetMockServices)); | 111 // &MockBluetoothDevice::GetMockServices)); |
| 112 void AddMockService(std::unique_ptr<MockBluetoothGattService> mock_device); | 112 void AddMockService(std::unique_ptr<MockBluetoothGattService> mock_device); |
| 113 std::vector<BluetoothRemoteGattService*> GetMockServices() const; | 113 std::vector<BluetoothRemoteGattService*> GetMockServices() const; |
| 114 BluetoothRemoteGattService* GetMockService( | 114 BluetoothRemoteGattService* GetMockService( |
| 115 const std::string& identifier) const; | 115 const std::string& identifier) const; |
| 116 | 116 |
| 117 void AddUUID(const BluetoothUUID& uuid) { uuids_.push_back(uuid); } |
| 118 |
| 117 void SetConnected(bool connected) { connected_ = connected; } | 119 void SetConnected(bool connected) { connected_ = connected; } |
| 118 | 120 |
| 119 private: | 121 private: |
| 120 uint32_t bluetooth_class_; | 122 uint32_t bluetooth_class_; |
| 121 base::Optional<std::string> name_; | 123 base::Optional<std::string> name_; |
| 122 std::string address_; | 124 std::string address_; |
| 123 BluetoothDevice::UUIDList uuids_; | 125 BluetoothDevice::UUIDList uuids_; |
| 124 bool connected_; | 126 bool connected_; |
| 125 | 127 |
| 126 ScopedVector<MockBluetoothGattService> mock_services_; | 128 ScopedVector<MockBluetoothGattService> mock_services_; |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 } // namespace device | 131 } // namespace device |
| 130 | 132 |
| 131 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ | 133 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_ |
| OLD | NEW |