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