aboutsummaryrefslogtreecommitdiff
path: root/tests/backend-dbus/mock-end-session-dialog.h
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2013-08-27 12:55:22 -0500
committerTed Gould <ted@gould.cx>2013-08-27 12:55:22 -0500
commitc440b9d6a1737e3be03e205e32fec64ebdfcb2df (patch)
treeb74867b600c41ff03ed87565eae38d2daaa47d5f /tests/backend-dbus/mock-end-session-dialog.h
parent4661ef2d0a834509194d069466e3905aece05183 (diff)
parentb7a8f35077f950dc6dab640e759341c1c2476f5c (diff)
downloadayatana-indicator-session-c440b9d6a1737e3be03e205e32fec64ebdfcb2df.tar.gz
ayatana-indicator-session-c440b9d6a1737e3be03e205e32fec64ebdfcb2df.tar.bz2
ayatana-indicator-session-c440b9d6a1737e3be03e205e32fec64ebdfcb2df.zip
Merging trunk
Diffstat (limited to 'tests/backend-dbus/mock-end-session-dialog.h')
-rw-r--r--tests/backend-dbus/mock-end-session-dialog.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/backend-dbus/mock-end-session-dialog.h b/tests/backend-dbus/mock-end-session-dialog.h
new file mode 100644
index 0000000..468715c
--- /dev/null
+++ b/tests/backend-dbus/mock-end-session-dialog.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2013 Canonical Ltd.
+ *
+ * Authors:
+ * Charles Kerr <charles.kerr@canonical.com>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 3, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MOCK_END_SESSION_DIALOG_H
+#define MOCK_END_SESSION_DIALOG_H
+
+#include "mock-object.h" // parent class
+#include "backend-dbus/dbus-end-session-dialog.h" // EndSessionDialog
+
+class MockEndSessionDialog: public MockObject
+{
+ public:
+
+ MockEndSessionDialog (GMainLoop * loop,
+ GDBusConnection * bus_connection);
+ virtual ~MockEndSessionDialog ();
+
+ bool is_open () const { return my_isOpen; }
+
+ void cancel () { my_isOpen = false; end_session_dialog_emit_canceled (my_skeleton); }
+ void confirm_logout () { my_isOpen = false; end_session_dialog_emit_confirmed_logout (my_skeleton); }
+ void confirm_reboot () { my_isOpen = false; end_session_dialog_emit_confirmed_reboot (my_skeleton); }
+ void confirm_shutdown () { my_isOpen = false; end_session_dialog_emit_confirmed_shutdown (my_skeleton); }
+ void close () { my_isOpen = false; end_session_dialog_emit_closed (my_skeleton); }
+
+ private:
+
+ EndSessionDialog * my_skeleton;
+
+ bool my_isOpen;
+
+ static gboolean handle_open (EndSessionDialog *,
+ GDBusMethodInvocation *,
+ guint,
+ guint,
+ guint,
+ const gchar * const *,
+ gpointer);
+
+
+#if 0
+ static gboolean handle_lock (GnomeScreenSaver *,
+ GDBusMethodInvocation *,
+ gpointer);
+ static gboolean handle_simulate_user_activity (GnomeScreenSaver *,
+ GDBusMethodInvocation *,
+ gpointer);
+#endif
+};
+
+#endif