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

Unified Diff: chromeos/dbus/fake_bluetooth_profile_manager_client.h

Issue 14487002: Bluetooth: Profile support for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit tests, and class comments Created 7 years, 7 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_profile_manager_client.h
diff --git a/chromeos/dbus/fake_bluetooth_profile_manager_client.h b/chromeos/dbus/fake_bluetooth_profile_manager_client.h
index e3cfcd446e6a75bda4e5e8defc0b71f80db6d7ae..bba67323a05200feef99831cfc0ac0297dcbe69f 100644
--- a/chromeos/dbus/fake_bluetooth_profile_manager_client.h
+++ b/chromeos/dbus/fake_bluetooth_profile_manager_client.h
@@ -5,6 +5,9 @@
#ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_
#define CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_MANAGER_CLIENT_H_
+#include <map>
+#include <string>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/observer_list.h"
@@ -16,6 +19,8 @@
namespace chromeos {
+class FakeBluetoothProfileServiceProvider;
+
// FakeBluetoothProfileManagerClient simulates the behavior of the Bluetooth
// Daemon's profile manager object and is used both in test cases in place of a
// mock and on the Linux desktop.
@@ -34,6 +39,33 @@ class CHROMEOS_EXPORT FakeBluetoothProfileManagerClient
virtual void UnregisterProfile(const dbus::ObjectPath& profile_path,
const base::Closure& callback,
const ErrorCallback& error_callback) OVERRIDE;
+
+ // Register, unregister and retrieve pointers to profile server providers.
+ void RegisterProfileServiceProvider(
+ FakeBluetoothProfileServiceProvider* service_provider);
+ void UnregisterProfileServiceProvider(
+ FakeBluetoothProfileServiceProvider* service_provider);
+ FakeBluetoothProfileServiceProvider* GetProfileServiceProvider(
+ const std::string& uuid);
+
+ // UUIDs recognised for testing.
+ static const char kL2capUuid[];
+ static const char kRfcommUuid[];
+
+ private:
+ // Map of a D-Bus object path to the FakeBluetoothProfileServiceProvider
+ // registered for it; maintained by RegisterProfileServiceProvider() and
+ // UnregisterProfileServiceProvicer() called by the constructor and
+ // destructor of FakeBluetoothProfileServiceProvider.
+ typedef std::map<dbus::ObjectPath, FakeBluetoothProfileServiceProvider*>
+ ServiceProviderMap;
+ ServiceProviderMap service_provider_map_;
+
+ // Map of Profile UUID to the D-Bus object path of the service provider
+ // in |service_provider_map_|. Maintained by RegisterProfile() and
+ // UnregisterProfile() in response to BluetoothProfile methods.
+ typedef std::map<std::string, dbus::ObjectPath> ProfileMap;
+ ProfileMap profile_map_;
};
} // namespace chromeos
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.cc ('k') | chromeos/dbus/fake_bluetooth_profile_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698