Further cleanup around DBus interface classes.
* Removed the "Glib" part from the various DbusGlib class name and added
"Wrapper" instead: only part of the methods here declared have
anything to do with Glib; in essence, this is an interface containing
wrappers for various DBus functions.
* Changed "Dbus" to "DBus", to comply with the rest of the world.
* Renamed the actual implementation "RealDBusWrapper" (instead of
"Concrete").
* Separated out RealDBusWrapper into its own header file. Client code,
which often only cares about the abstract class, does not need to pull
it unless specifically requiring it.
* Cleaned up the includes in these headers.
Aside from all that, also renamed system_state.cc into
real_system_state.cc, as this is what this file contains.
BUG=None
TEST=Unit tests.
Change-Id: I015c407cbc159aba8b5925eb0e916ba604c829cd
Reviewed-on: https://chromium-review.googlesource.com/189373
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/mock_dbus_wrapper.h b/mock_dbus_wrapper.h
new file mode 100644
index 0000000..9fc9a8f
--- /dev/null
+++ b/mock_dbus_wrapper.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_
+
+#include <gmock/gmock.h>
+
+#include "update_engine/dbus_wrapper_interface.h"
+
+namespace chromeos_update_engine {
+
+class MockDBusWrapper : public DBusWrapperInterface {
+ public:
+ MOCK_METHOD4(ProxyNewForName, DBusGProxy*(DBusGConnection *connection,
+ const char *name,
+ const char *path,
+ const char *interface));
+
+ MOCK_METHOD1(ProxyUnref, void(DBusGProxy* proxy));
+
+ MOCK_METHOD2(BusGet, DBusGConnection*(DBusBusType type, GError **error));
+
+ MOCK_METHOD4(ProxyCall_0_1, gboolean(DBusGProxy *proxy,
+ const char *method,
+ GError **error,
+ GHashTable** out1));
+ MOCK_METHOD6(ProxyCall_3_0, gboolean(DBusGProxy* proxy,
+ const char* method,
+ GError** error,
+ const char* in1,
+ const char* in2,
+ const char* in3));
+
+ MOCK_METHOD1(ConnectionGetConnection, DBusConnection*(DBusGConnection* gbus));
+
+ MOCK_METHOD3(DBusBusAddMatch, void(DBusConnection* connection,
+ const char* rule,
+ DBusError* error));
+
+ MOCK_METHOD4(DBusConnectionAddFilter, dbus_bool_t(
+ DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data,
+ DBusFreeFunction free_data_function));
+
+ MOCK_METHOD3(DBusConnectionRemoveFilter, void(
+ DBusConnection* connection,
+ DBusHandleMessageFunction function,
+ void* user_data));
+
+ MOCK_METHOD3(DBusMessageIsSignal, dbus_bool_t(DBusMessage* message,
+ const char* interface,
+ const char* signal_name));
+
+ MOCK_METHOD5(DBusMessageGetArgs_3, dbus_bool_t(DBusMessage* message,
+ DBusError* error,
+ char** out1,
+ char** out2,
+ char** out3));
+};
+
+} // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_