Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_device_client.h

Issue 2792203003: Revert of Bluetooth: Add service data unit tests for chromeos (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_
6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_
7 7
8 #include <cstdint> 8 #include <cstdint>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // by GetConnInfo. 149 // by GetConnInfo.
150 void UpdateConnectionInfo(uint16_t connection_rssi, 150 void UpdateConnectionInfo(uint16_t connection_rssi,
151 uint16_t transmit_power, 151 uint16_t transmit_power,
152 uint16_t max_transmit_power); 152 uint16_t max_transmit_power);
153 153
154 // Test specific functions: 154 // Test specific functions:
155 // Remove all test devices from this client. 155 // Remove all test devices from this client.
156 void RemoveAllDevices(); 156 void RemoveAllDevices();
157 157
158 // Create a test Bluetooth device with the given properties. 158 // Create a test Bluetooth device with the given properties.
159 void CreateTestDevice( 159 void CreateTestDevice(const dbus::ObjectPath& adapter_path,
160 const dbus::ObjectPath& adapter_path, 160 const base::Optional<std::string> name,
161 const base::Optional<std::string> name, 161 const std::string alias,
162 const std::string alias, 162 const std::string device_address,
163 const std::string device_address, 163 const std::vector<std::string>& service_uuids,
164 const std::vector<std::string>& service_uuids, 164 device::BluetoothTransport type);
165 device::BluetoothTransport type,
166 const std::unordered_map<std::string, std::vector<uint8_t>>&
167 service_data);
168 165
169 void set_delay_start_discovery(bool value) { delay_start_discovery_ = value; } 166 void set_delay_start_discovery(bool value) { delay_start_discovery_ = value; }
170 167
171 // Updates the inquiry RSSI property of fake device with object path 168 // Updates the inquiry RSSI property of fake device with object path
172 // |object_path| to |rssi|, if the fake device exists. 169 // |object_path| to |rssi|, if the fake device exists.
173 void UpdateDeviceRSSI(const dbus::ObjectPath& object_path, int16_t rssi); 170 void UpdateDeviceRSSI(const dbus::ObjectPath& object_path, int16_t rssi);
174 171
175 // Updates the service data property of fake device with object path
176 // |object_path| to merge |service_data| into the existing data,
177 // if the fake device exists.
178 void UpdateServiceData(
179 const dbus::ObjectPath& object_path,
180 const std::unordered_map<std::string, std::vector<uint8_t>>&
181 service_data);
182
183 static const char kTestPinCode[]; 172 static const char kTestPinCode[];
184 static const int kTestPassKey; 173 static const int kTestPassKey;
185 174
186 static const char kPairingMethodNone[]; 175 static const char kPairingMethodNone[];
187 static const char kPairingMethodPinCode[]; 176 static const char kPairingMethodPinCode[];
188 static const char kPairingMethodPassKey[]; 177 static const char kPairingMethodPassKey[];
189 178
190 static const char kPairingActionConfirmation[]; 179 static const char kPairingActionConfirmation[];
191 static const char kPairingActionDisplay[]; 180 static const char kPairingActionDisplay[];
192 static const char kPairingActionFail[]; 181 static const char kPairingActionFail[];
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 int16_t max_transmit_power_; 345 int16_t max_transmit_power_;
357 346
358 // Controls the fake behavior to allow more extensive UI testing without 347 // Controls the fake behavior to allow more extensive UI testing without
359 // having to cycle the discovery simulation. 348 // having to cycle the discovery simulation.
360 bool delay_start_discovery_; 349 bool delay_start_discovery_;
361 }; 350 };
362 351
363 } // namespace bluez 352 } // namespace bluez
364 353
365 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ 354 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_bluez_unittest.cc ('k') | device/bluetooth/dbus/fake_bluetooth_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698