blob: 5d630a6efe2af5058d64c4ab2417a09c5fbc49a8 [file] [log] [blame]
Andrew de los Reyesd57d1472010-10-21 13:34:08 -07001// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Gilad Arnoldcf175a02014-07-10 16:48:47 -07005#ifndef UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_
6#define UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_
Andrew de los Reyesd57d1472010-10-21 13:34:08 -07007
8#include <gmock/gmock.h>
9
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080010#include "update_engine/dbus_wrapper_interface.h"
Andrew de los Reyesd57d1472010-10-21 13:34:08 -070011
12namespace chromeos_update_engine {
13
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080014class MockDBusWrapper : public DBusWrapperInterface {
Andrew de los Reyesd57d1472010-10-21 13:34:08 -070015 public:
Gilad Arnoldb752fb32014-03-03 12:23:39 -080016 MOCK_METHOD4(ProxyNewForName, DBusGProxy*(DBusGConnection *connection,
17 const char *name,
18 const char *path,
19 const char *interface));
Andrew de los Reyesd57d1472010-10-21 13:34:08 -070020
21 MOCK_METHOD1(ProxyUnref, void(DBusGProxy* proxy));
22
23 MOCK_METHOD2(BusGet, DBusGConnection*(DBusBusType type, GError **error));
24
Gilad Arnoldb752fb32014-03-03 12:23:39 -080025 MOCK_METHOD4(ProxyCall_0_1, gboolean(DBusGProxy *proxy,
26 const char *method,
27 GError **error,
28 GHashTable** out1));
David Pursell02c18642014-11-06 11:26:11 -080029 MOCK_METHOD4(ProxyCall_0_1, gboolean(DBusGProxy *proxy,
30 const char *method,
31 GError **error,
32 gint* out1));
Daniel Erat65f1da02014-06-27 22:05:38 -070033 MOCK_METHOD4(ProxyCall_1_0, gboolean(DBusGProxy *proxy,
34 const char *method,
35 GError **error,
36 gint in1));
Gilad Arnoldb752fb32014-03-03 12:23:39 -080037 MOCK_METHOD6(ProxyCall_3_0, gboolean(DBusGProxy* proxy,
38 const char* method,
39 GError** error,
40 const char* in1,
41 const char* in2,
42 const char* in3));
Andrew de los Reyes000d8952011-03-02 15:21:14 -080043
Alex Deymo9b7ae1a2014-12-15 10:35:56 -080044 MOCK_METHOD3(ProxyAddSignal_1, void(DBusGProxy* proxy,
45 const char* signal_name,
46 GType type1));
47
Gilad Arnoldbeb39e92014-03-11 11:34:50 -070048 MOCK_METHOD4(ProxyAddSignal_2, void(DBusGProxy* proxy,
49 const char* signal_name,
50 GType type1,
51 GType type2));
52
53 MOCK_METHOD5(ProxyConnectSignal, void(DBusGProxy* proxy,
54 const char* signal_name,
55 GCallback handler,
56 void* data,
57 GClosureNotify free_data_func));
58
59 MOCK_METHOD4(ProxyDisconnectSignal, void(DBusGProxy* proxy,
60 const char* signal_name,
61 GCallback handler,
62 void* data));
63
Andrew de los Reyes000d8952011-03-02 15:21:14 -080064 MOCK_METHOD1(ConnectionGetConnection, DBusConnection*(DBusGConnection* gbus));
65
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080066 MOCK_METHOD3(DBusBusAddMatch, void(DBusConnection* connection,
Andrew de los Reyes000d8952011-03-02 15:21:14 -080067 const char* rule,
68 DBusError* error));
69
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080070 MOCK_METHOD4(DBusConnectionAddFilter, dbus_bool_t(
Andrew de los Reyes000d8952011-03-02 15:21:14 -080071 DBusConnection* connection,
72 DBusHandleMessageFunction function,
73 void* user_data,
74 DBusFreeFunction free_data_function));
75
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080076 MOCK_METHOD3(DBusConnectionRemoveFilter, void(
Andrew de los Reyes000d8952011-03-02 15:21:14 -080077 DBusConnection* connection,
78 DBusHandleMessageFunction function,
79 void* user_data));
80
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080081 MOCK_METHOD3(DBusMessageIsSignal, dbus_bool_t(DBusMessage* message,
Andrew de los Reyes000d8952011-03-02 15:21:14 -080082 const char* interface,
83 const char* signal_name));
84
Gilad Arnold1b9d6ae2014-03-03 13:46:07 -080085 MOCK_METHOD5(DBusMessageGetArgs_3, dbus_bool_t(DBusMessage* message,
Gilad Arnoldb752fb32014-03-03 12:23:39 -080086 DBusError* error,
87 char** out1,
88 char** out2,
89 char** out3));
Andrew de los Reyesd57d1472010-10-21 13:34:08 -070090};
91
92} // namespace chromeos_update_engine
93
Gilad Arnoldcf175a02014-07-10 16:48:47 -070094#endif // UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_