Index: chromeos/dbus/fake_bluetooth_media_client.cc |
diff --git a/chromeos/dbus/fake_bluetooth_media_client.cc b/chromeos/dbus/fake_bluetooth_media_client.cc |
index 3e57b91f439b858851fe17f5532d4b8d8440f12e..22a1126c3b015d44442793969aff1861a4951989 100644 |
--- a/chromeos/dbus/fake_bluetooth_media_client.cc |
+++ b/chromeos/dbus/fake_bluetooth_media_client.cc |
@@ -4,6 +4,12 @@ |
#include "chromeos/dbus/fake_bluetooth_media_client.h" |
+namespace { |
+ |
+ const char kNotImplementedError[] = "org.chromium.Error.NotImplemented"; |
armansito
2015/01/27 04:38:05
nit: don't indent variables within namespace.
Miao
2015/01/28 02:05:01
Done.
|
+ const char kInvalidArgumentError[] = "org.chromium.Error.InvalidArgument"; |
armansito
2015/01/27 04:38:05
nit: newline.
Miao
2015/01/28 02:05:01
Done.
|
+} // namespace |
+ |
namespace chromeos { |
FakeBluetoothMediaClient::FakeBluetoothMediaClient() { |
@@ -27,15 +33,19 @@ void FakeBluetoothMediaClient::RemoveObserver( |
observers_.RemoveObserver(observer); |
} |
-// TODO(mcchou): Add method definition for |RegisterEndpoint|, |
-// |UnregisterEndpoint|, |RegisterPlayer| and |UnregisterPlayer|. |
void FakeBluetoothMediaClient::RegisterEndpoint( |
const dbus::ObjectPath& object_path, |
const dbus::ObjectPath& endpoint_path, |
const EndpointProperties& properties, |
const base::Closure& callback, |
const ErrorCallback& error_callback) { |
- error_callback.Run("org.bluez.NotImplemented", ""); |
+ VLOG(1) << "RegisterEndpoint: " << endpoint_path.value(); |
+ media_path_ = object_path; |
armansito
2015/01/27 04:38:05
I'm not exactly sure what you're using |media_path
Miao
2015/01/28 02:05:01
Done.
|
+ if (properties.capabilities.empty()) { |
armansito
2015/01/27 04:38:05
What about the |codec| and |uuid| fields?
Miao
2015/01/28 02:05:01
Done.
|
+ error_callback.Run(kInvalidArgumentError, ""); |
+ return; |
+ } |
+ callback.Run(); |
} |
void FakeBluetoothMediaClient::UnregisterEndpoint( |
@@ -43,7 +53,7 @@ void FakeBluetoothMediaClient::UnregisterEndpoint( |
const dbus::ObjectPath& endpoint_path, |
const base::Closure& callback, |
const ErrorCallback& error_callback) { |
- error_callback.Run("org.bluez.NotImplemented", ""); |
+ error_callback.Run(kNotImplementedError, ""); |
} |
} // namespace chromeos |