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

Unified Diff: chromeos/dbus/fake_bluetooth_media_transport_client.h

Issue 910023002: device/bluetooth:Implement BluetoothMediaEndpointServiceProvider delegate and media-related overrid… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the addition/removal of all types of observer to constructor/destructor. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/fake_bluetooth_media_transport_client.h
diff --git a/chromeos/dbus/fake_bluetooth_media_transport_client.h b/chromeos/dbus/fake_bluetooth_media_transport_client.h
index ce33dc073eb2a228dbc6621283f111f0db2cf444..f88908f6111db8919c39632a6bac9022d075118a 100644
--- a/chromeos/dbus/fake_bluetooth_media_transport_client.h
+++ b/chromeos/dbus/fake_bluetooth_media_transport_client.h
@@ -5,8 +5,11 @@
#ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_
#define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_TRANSPORT_CLIENT_H_
+#include <map>
#include <string>
+#include <vector>
+#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/bluetooth_media_transport_client.h"
@@ -28,6 +31,17 @@ class CHROMEOS_EXPORT FakeBluetoothMediaTransportClient
dbus::PropertySet::SetCallback callback) override;
};
+ // The default path of the transport object.
+ static const char kTransportPath[];
+
+ // The default properties including device, codec, configuration, state, delay
+ // and volume, owned by a fake media transport object we emulate.
+ static const char kTransportDevicePath[];
+ static const uint8_t kTransportCodec;
+ static const std::vector<uint8_t> kTransportConfiguration;
+ static const uint16_t kTransportDelay;
+ static const uint16_t kTransportVolume;
+
FakeBluetoothMediaTransportClient();
~FakeBluetoothMediaTransportClient() override;
@@ -48,7 +62,24 @@ class CHROMEOS_EXPORT FakeBluetoothMediaTransportClient
const base::Closure& callback,
const ErrorCallback& error_callback) override;
+ // Makes the transport valid/invalid for a given media endpoint path. The
+ // transport object is assigned to the given endpoint if valid is true, false
+ // otherwise.
+ void SetValid(const dbus::ObjectPath& endpoint_path, bool valid);
+
private:
+ // Property callback passed while a Properties structure is created.
+ void OnPropertyChanged(const std::string& property_name);
+
+ // The path of the media transport object.
+ dbus::ObjectPath object_path_;
+
+ // Indicates whether endpoints are assigned with the transport object.
+ std::map<dbus::ObjectPath, bool> endpoints_;
+
+ // The fake property set of the media transport object.
+ scoped_ptr<Properties> properties_;
+
ObserverList<BluetoothMediaTransportClient::Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaTransportClient);

Powered by Google App Engine
This is Rietveld 408576698