diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/backend-dbus/mock-end-session-dialog.cc | 28 | ||||
-rw-r--r-- | tests/backend-dbus/mock-login1-manager.cc | 96 | ||||
-rw-r--r-- | tests/backend-dbus/mock-login1-seat.cc | 6 | ||||
-rw-r--r-- | tests/backend-dbus/mock-user.cc | 8 | ||||
-rw-r--r-- | tests/backend-dbus/mock-webcredentials.cc | 15 |
5 files changed, 4 insertions, 149 deletions
diff --git a/tests/backend-dbus/mock-end-session-dialog.cc b/tests/backend-dbus/mock-end-session-dialog.cc index 903962b..2772423 100644 --- a/tests/backend-dbus/mock-end-session-dialog.cc +++ b/tests/backend-dbus/mock-end-session-dialog.cc @@ -19,28 +19,6 @@ #include "mock-end-session-dialog.h" -#if 0 -gboolean -MockEndSessionDialog :: handle_lock (GnomeScreenSaver * ss, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockEndSessionDialog*>(gself)->my_last_action = Lock; - gnome_screen_saver_complete_lock (ss, inv); - return true; -} - -gboolean -MockEndSessionDialog :: handle_simulate_user_activity (GnomeScreenSaver * ss, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockEndSessionDialog*>(gself)->my_last_action = UserActivity; - gnome_screen_saver_complete_simulate_user_activity (ss, inv); - return true; -} -#endif - gboolean MockEndSessionDialog :: handle_open (EndSessionDialog * object, GDBusMethodInvocation * invocation, @@ -73,12 +51,6 @@ MockEndSessionDialog :: MockEndSessionDialog (GMainLoop * loop, { g_signal_connect (my_skeleton, "handle-open", G_CALLBACK(handle_open), this); -#if 0 - g_signal_connect (my_skeleton, "handle-lock", - G_CALLBACK(handle_lock), this); - g_signal_connect (my_skeleton, "handle-simulate-user-activity", - G_CALLBACK(handle_simulate_user_activity), this); -#endif set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton)); } diff --git a/tests/backend-dbus/mock-login1-manager.cc b/tests/backend-dbus/mock-login1-manager.cc index 3bd652b..4461125 100644 --- a/tests/backend-dbus/mock-login1-manager.cc +++ b/tests/backend-dbus/mock-login1-manager.cc @@ -26,99 +26,17 @@ namespace const char * const BUS_NAME = "org.freedesktop.login1"; const char * const BUS_PATH = "/org/freedesktop/login1"; - -#if 0 - void on_active_session_changed (Login1Seat * o G_GNUC_UNUSED, - const gchar * new_ssid, - gpointer ssid) - { - *static_cast<std::string*>(ssid) = new_ssid; - } -#endif -} - -/*** -**** -***/ - -#if 0 -gboolean -MockLogin1Manager :: on_get_current_session (Login1Manager * m, - GDBusMethodInvocation * inv, - gpointer gself) -{ - MockLogin1Manager * self = static_cast<MockLogin1Manager*>(gself); - const std::string& ssid = self->my_current_ssid; - console_kit_manager_complete_get_current_session (m, inv, ssid.c_str()); - return true; -} - -gboolean -MockLogin1Manager :: on_get_seats (Login1Manager * m, - GDBusMethodInvocation * inv, - gpointer gself) -{ - int i; - char ** sids; - const seats_t& seats = static_cast<MockLogin1Manager*>(gself)->my_seats; - - i = 0; - sids = g_new0 (char*, seats.size()+1); - for (seats_t::const_iterator it(seats.begin()), - end(seats.end()); it!=end; ++it) - sids[i++] = (char*) (*it)->path(); - console_kit_manager_complete_get_seats (m, inv, sids); - g_strfreev (sids); - - return true; -} - -gboolean -MockLogin1Manager :: handle_restart (Login1Manager * ckm, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockLogin1Manager*>(gself)->my_last_action = Restart; - console_kit_manager_complete_restart (ckm, inv); - return true; } -gboolean -MockLogin1Manager :: handle_stop (Login1Manager * ckm, - GDBusMethodInvocation * inv, - gpointer gself) -{ - static_cast<MockLogin1Manager*>(gself)->my_last_action = Shutdown; - console_kit_manager_complete_stop (ckm, inv); - return true; -} -#endif - /*** **** ***/ -#if 0 -MockLogin1Session * -MockLogin1Manager :: current_session () -{ - MockLogin1Session * ret = 0; - - for (seats_t::iterator it(my_seats.begin()), - end(my_seats.end()); it!=end; ++it) - if ((ret = (*it)->find (my_current_ssid.c_str()))) - break; - - return ret; -} -#endif - void MockLogin1Manager :: emit_session_new (MockLogin1Seat * seat, int tag) const { std::string id; std::string path; - seat->get_session_id_and_path_for_tag (tag, id, path); login1_manager_emit_session_new (my_skeleton, id.c_str(), path.c_str()); @@ -139,7 +57,6 @@ MockLogin1Manager :: emit_session_removed (MockLogin1Seat * seat, int tag) const { std::string id; std::string path; - seat->get_session_id_and_path_for_tag (tag, id, path); login1_manager_emit_session_removed (my_skeleton, id.c_str(), path.c_str()); @@ -188,9 +105,7 @@ MockLogin1Manager :: list_sessions () const } } - GVariant * v = g_variant_builder_end (&b); - g_message ("%s %s returning %s", G_STRLOC, G_STRFUNC, g_variant_print (v, true)); - return v; + return g_variant_builder_end (&b); } /*** @@ -313,15 +228,6 @@ MockLogin1Manager :: MockLogin1Manager (GMainLoop * loop, g_signal_connect (my_skeleton, "handle-list-sessions", G_CALLBACK(handle_list_sessions), this); -#if 0 - g_signal_connect (my_skeleton, "handle-get-seats", - G_CALLBACK(on_get_seats), this); - g_signal_connect (my_skeleton, "handle-stop", - G_CALLBACK(handle_stop), this); - g_signal_connect (my_skeleton, "handle-restart", - G_CALLBACK(handle_restart), this); -#endif - set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton)); } diff --git a/tests/backend-dbus/mock-login1-seat.cc b/tests/backend-dbus/mock-login1-seat.cc index 46dc5f9..49d7fb6 100644 --- a/tests/backend-dbus/mock-login1-seat.cc +++ b/tests/backend-dbus/mock-login1-seat.cc @@ -43,7 +43,9 @@ namespace } void -MockLogin1Seat :: get_session_id_and_path_for_tag (int tag, std::string& id, std::string& path) +MockLogin1Seat :: get_session_id_and_path_for_tag (int tag, + std::string & id, + std::string & path) { if (tag) { @@ -81,7 +83,6 @@ MockLogin1Seat :: update_sessions_property () } GVariant * v = g_variant_builder_end (&b); - g_message ("%s %s setting session property to %s", G_STRLOC, G_STRFUNC, g_variant_print (v, true)); g_object_set (my_skeleton, "sessions", v, NULL); } @@ -93,7 +94,6 @@ MockLogin1Seat :: update_active_session_property () get_session_id_and_path_for_tag (my_active_session, id, path); GVariant * v = g_variant_new ("(so)", id.c_str(), path.c_str()); - g_message ("%s %s setting active session property to %s", G_STRLOC, G_STRFUNC, g_variant_print (v, true)); g_object_set (my_skeleton, "active-session", v, NULL); } diff --git a/tests/backend-dbus/mock-user.cc b/tests/backend-dbus/mock-user.cc index abf2e21..f74b5a4 100644 --- a/tests/backend-dbus/mock-user.cc +++ b/tests/backend-dbus/mock-user.cc @@ -54,14 +54,6 @@ MockUser :: login_frequency () const return accounts_user_get_login_frequency (my_skeleton); } -#if 0 -bool -MockUser :: system_account() const -{ - return accounts_user_get_system_account (my_skeleton); -} -#endif - void MockUser :: set_system_account (gboolean b) { diff --git a/tests/backend-dbus/mock-webcredentials.cc b/tests/backend-dbus/mock-webcredentials.cc index 44fa8ac..22e10b7 100644 --- a/tests/backend-dbus/mock-webcredentials.cc +++ b/tests/backend-dbus/mock-webcredentials.cc @@ -30,21 +30,6 @@ MockWebcredentials :: MockWebcredentials (GMainLoop * loop, MockObject (loop, bus_connection, MY_NAME, MY_PATH), my_skeleton (webcredentials_skeleton_new ()) { - //set_can_hibernate (false); - //set_can_suspend (true); - -#if 0 - g_signal_connect (my_skeleton, "handle-suspend", - G_CALLBACK(handle_suspend), this); - g_signal_connect (my_skeleton, "handle-suspend-allowed", - G_CALLBACK(handle_suspend_allowed), this); - - g_signal_connect (my_skeleton, "handle-hibernate", - G_CALLBACK(handle_hibernate), this); - g_signal_connect (my_skeleton, "handle-hibernate-allowed", - G_CALLBACK(handle_hibernate_allowed), this); -#endif - set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton)); } |