Chromium Code Reviews| Index: chromeos/dbus/fake_bluetooth_device_client.h |
| diff --git a/chromeos/dbus/fake_bluetooth_device_client.h b/chromeos/dbus/fake_bluetooth_device_client.h |
| index a9e6c19bec8ea6c3118adff30b262e7bcc0e80a7..6c678384a27f68efca51b4f90869e066d1a995f0 100644 |
| --- a/chromeos/dbus/fake_bluetooth_device_client.h |
| +++ b/chromeos/dbus/fake_bluetooth_device_client.h |
| @@ -38,6 +38,11 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient |
| dbus::PropertySet::SetCallback callback) override; |
| }; |
| + struct SimulatedPairingOptions { |
| + std::string pairing_method; |
| + std::string pairing_auth_token; |
| + }; |
| + |
| FakeBluetoothDeviceClient(); |
| ~FakeBluetoothDeviceClient() override; |
| @@ -48,6 +53,8 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient |
| std::vector<dbus::ObjectPath> GetDevicesForAdapter( |
| const dbus::ObjectPath& adapter_path) override; |
| Properties* GetProperties(const dbus::ObjectPath& object_path) override; |
| + SimulatedPairingOptions* GetPairingOptions( |
|
xiyuan
2015/07/30 17:21:22
This is not overridden from BluetoothDeviceClient.
xiyuan
2015/07/30 23:30:37
What about this?
rfrappier
2015/07/31 00:56:00
Missed that one, sorry about that.
Done
|
| + const dbus::ObjectPath& object_path); |
| void Connect(const dbus::ObjectPath& object_path, |
| const base::Closure& callback, |
| const ErrorCallback& error_callback) override; |
| @@ -73,6 +80,8 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient |
| const ErrorCallback& error_callback) override; |
| void SetSimulationIntervalMs(int interval_ms); |
| + static void SimpleErrorCallback(const std::string& error_name, |
| + const std::string& error_message); |
| // Simulates discovery of devices for the given adapter. |
| void BeginDiscoverySimulation(const dbus::ObjectPath& adapter_path); |
| @@ -86,6 +95,17 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient |
| void CreateDevice(const dbus::ObjectPath& adapter_path, |
| const dbus::ObjectPath& device_path); |
| + // Creates a device with the given properties. |
| + void CreateDeviceWithProperties(const dbus::ObjectPath& adapter_path, |
| + const dbus::ObjectPath& device_path, |
| + const std::string& device_name, |
| + const std::string& device_alias, |
| + const std::string& device_address, |
| + const std::string& pairing_method, |
| + const std::string& pairing_auth_token, |
| + const uint32& device_class, |
| + const bool is_trusted); |
|
stevenjb
2015/07/30 18:28:52
We should put all of the arguments after |device_p
rfrappier
2015/07/30 22:21:39
Done.
|
| + |
| // Removes a device from the set we return for the given adapter. |
| void RemoveDevice(const dbus::ObjectPath& adapter_path, |
| const dbus::ObjectPath& device_path); |
| @@ -246,11 +266,16 @@ class CHROMEOS_EXPORT FakeBluetoothDeviceClient |
| // List of observers interested in event notifications from us. |
| base::ObserverList<Observer> observers_; |
| - // Static properties we return. |
| typedef std::map<const dbus::ObjectPath, Properties *> PropertiesMap; |
| PropertiesMap properties_map_; |
| std::vector<dbus::ObjectPath> device_list_; |
| + // Properties which are used to decied which method of pairing should |
| + // be done on request. |
| + typedef std::map<const dbus::ObjectPath, SimulatedPairingOptions*> |
| + PairingOptionsMap; |
| + PairingOptionsMap pairing_options_map_; |
|
stevenjb
2015/07/30 18:28:52
Ideally we should use ScopedPtrMap now that it exi
rfrappier
2015/07/30 22:21:39
Done.
|
| + |
| int simulation_interval_ms_; |
| uint32_t discovery_simulation_step_; |
| uint32_t incoming_pairing_simulation_step_; |