summaryrefslogtreecommitdiffstats
path: root/dbus/mock_bus.h
diff options
context:
space:
mode:
authorkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 20:08:06 +0000
committerkeybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-14 20:08:06 +0000
commitbc1b18ecfc890dde4aae0a5a5db27dde2796b25e (patch)
tree8e37e62d98047d218bf8fdeff2f10361fbaab961 /dbus/mock_bus.h
parentce1402accb9a01358fc1235f1319d934cd611248 (diff)
downloadchromium_src-bc1b18ecfc890dde4aae0a5a5db27dde2796b25e.zip
chromium_src-bc1b18ecfc890dde4aae0a5a5db27dde2796b25e.tar.gz
chromium_src-bc1b18ecfc890dde4aae0a5a5db27dde2796b25e.tar.bz2
dbus: add ObjectPath type
Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Review URL: http://codereview.chromium.org/9378039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/mock_bus.h')
-rw-r--r--dbus/mock_bus.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/dbus/mock_bus.h b/dbus/mock_bus.h
index 31c1349..463790a 100644
--- a/dbus/mock_bus.h
+++ b/dbus/mock_bus.h
@@ -7,6 +7,7 @@
#pragma once
#include "dbus/bus.h"
+#include "dbus/object_path.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace dbus {
@@ -20,14 +21,14 @@ class MockBus : public Bus {
virtual ~MockBus();
MOCK_METHOD2(GetObjectProxy, ObjectProxy*(const std::string& service_name,
- const std::string& object_path));
+ const ObjectPath& object_path));
MOCK_METHOD3(GetObjectProxyWithOptions,
ObjectProxy*(const std::string& service_name,
- const std::string& object_path,
+ const ObjectPath& object_path,
int options));
MOCK_METHOD2(GetExportedObject, ExportedObject*(
const std::string& service_name,
- const std::string& object_path));
+ const ObjectPath& object_path));
MOCK_METHOD0(ShutdownAndBlock, void());
MOCK_METHOD0(ShutdownOnDBusThreadAndBlock, void());
MOCK_METHOD0(Connect, bool());
@@ -50,11 +51,11 @@ class MockBus : public Bus {
DBusError* error));
MOCK_METHOD2(RemoveMatch, void(const std::string& match_rule,
DBusError* error));
- MOCK_METHOD4(TryRegisterObjectPath, bool(const std::string& object_path,
+ MOCK_METHOD4(TryRegisterObjectPath, bool(const ObjectPath& object_path,
const DBusObjectPathVTable* vtable,
void* user_data,
DBusError* error));
- MOCK_METHOD1(UnregisterObjectPath, void(const std::string& object_path));
+ MOCK_METHOD1(UnregisterObjectPath, void(const ObjectPath& object_path));
MOCK_METHOD2(PostTaskToOriginThread, void(
const tracked_objects::Location& from_here,
const base::Closure& task));