Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 1 | // 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 Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 5 | #ifndef UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_ |
| 6 | #define UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_ |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 10 | #include "update_engine/dbus_wrapper_interface.h" |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 11 | |
| 12 | namespace chromeos_update_engine { |
| 13 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 14 | class MockDBusWrapper : public DBusWrapperInterface { |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 15 | public: |
Gilad Arnold | b752fb3 | 2014-03-03 12:23:39 -0800 | [diff] [blame] | 16 | MOCK_METHOD4(ProxyNewForName, DBusGProxy*(DBusGConnection *connection, |
| 17 | const char *name, |
| 18 | const char *path, |
| 19 | const char *interface)); |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 20 | |
| 21 | MOCK_METHOD1(ProxyUnref, void(DBusGProxy* proxy)); |
| 22 | |
| 23 | MOCK_METHOD2(BusGet, DBusGConnection*(DBusBusType type, GError **error)); |
| 24 | |
Gilad Arnold | b752fb3 | 2014-03-03 12:23:39 -0800 | [diff] [blame] | 25 | MOCK_METHOD4(ProxyCall_0_1, gboolean(DBusGProxy *proxy, |
| 26 | const char *method, |
| 27 | GError **error, |
| 28 | GHashTable** out1)); |
David Pursell | 02c1864 | 2014-11-06 11:26:11 -0800 | [diff] [blame] | 29 | MOCK_METHOD4(ProxyCall_0_1, gboolean(DBusGProxy *proxy, |
| 30 | const char *method, |
| 31 | GError **error, |
| 32 | gint* out1)); |
Daniel Erat | 65f1da0 | 2014-06-27 22:05:38 -0700 | [diff] [blame] | 33 | MOCK_METHOD4(ProxyCall_1_0, gboolean(DBusGProxy *proxy, |
| 34 | const char *method, |
| 35 | GError **error, |
| 36 | gint in1)); |
Gilad Arnold | b752fb3 | 2014-03-03 12:23:39 -0800 | [diff] [blame] | 37 | 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 Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 43 | |
Alex Deymo | 9b7ae1a | 2014-12-15 10:35:56 -0800 | [diff] [blame] | 44 | MOCK_METHOD3(ProxyAddSignal_1, void(DBusGProxy* proxy, |
| 45 | const char* signal_name, |
| 46 | GType type1)); |
| 47 | |
Gilad Arnold | beb39e9 | 2014-03-11 11:34:50 -0700 | [diff] [blame] | 48 | 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 Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 64 | MOCK_METHOD1(ConnectionGetConnection, DBusConnection*(DBusGConnection* gbus)); |
| 65 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 66 | MOCK_METHOD3(DBusBusAddMatch, void(DBusConnection* connection, |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 67 | const char* rule, |
| 68 | DBusError* error)); |
| 69 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 70 | MOCK_METHOD4(DBusConnectionAddFilter, dbus_bool_t( |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 71 | DBusConnection* connection, |
| 72 | DBusHandleMessageFunction function, |
| 73 | void* user_data, |
| 74 | DBusFreeFunction free_data_function)); |
| 75 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 76 | MOCK_METHOD3(DBusConnectionRemoveFilter, void( |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 77 | DBusConnection* connection, |
| 78 | DBusHandleMessageFunction function, |
| 79 | void* user_data)); |
| 80 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 81 | MOCK_METHOD3(DBusMessageIsSignal, dbus_bool_t(DBusMessage* message, |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 82 | const char* interface, |
| 83 | const char* signal_name)); |
| 84 | |
Gilad Arnold | 1b9d6ae | 2014-03-03 13:46:07 -0800 | [diff] [blame] | 85 | MOCK_METHOD5(DBusMessageGetArgs_3, dbus_bool_t(DBusMessage* message, |
Gilad Arnold | b752fb3 | 2014-03-03 12:23:39 -0800 | [diff] [blame] | 86 | DBusError* error, |
| 87 | char** out1, |
| 88 | char** out2, |
| 89 | char** out3)); |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | } // namespace chromeos_update_engine |
| 93 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 94 | #endif // UPDATE_ENGINE_MOCK_DBUS_WRAPPER_H_ |