diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-13 22:02:46 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-02-13 22:57:53 +0100 |
commit | 8c4df6215a986695edc6c6530f6d6388ea9640d5 (patch) | |
tree | edbaa4c0de4c25d7e6ba5f2db9f46b819b6e6699 /tests/backend-dbus | |
parent | f9d1e0d63e454dbd280342ea42aa741d7a6a2003 (diff) | |
download | ayatana-indicator-session-8c4df6215a986695edc6c6530f6d6388ea9640d5.tar.gz ayatana-indicator-session-8c4df6215a986695edc6c6530f6d6388ea9640d5.tar.bz2 ayatana-indicator-session-8c4df6215a986695edc6c6530f6d6388ea9640d5.zip |
UnitySession -> LomiriSession: Re-rename related changes that we erroneously hid away as Ayatana DesktopSession.
This brings full Lomiri integration finally. Until now, the session
indicator somehow seemed to work, but in some odd ways. On the phone,
the session indicator would fallback to direct systemd interaction while
on Lomiri in Debian, it would fallback to Zenity dialogs (most of all
because Zenity got installed by some other package as a dependency).
With this massive renaming change, ayatana-indicator-session should now
smoothly interact with the com.lomiri.Shell.Session DBus interface and
also with the mimicked GNOME SessionManager End-Session-Dialog
interface.
As a downside, this change nearly fully removes Unity7 support which
would need to be brought back +/- as a full duplicate of what we do for
Lomiri. But as noone has dared integrating Ayatana Indicator Session
with Unity7, so far, we should be able to live with that for now.
Fixes https://github.com/AyatanaIndicators/ayatana-indicator-session/issues/82
Diffstat (limited to 'tests/backend-dbus')
-rw-r--r-- | tests/backend-dbus/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/backend-dbus/gtest-mock-dbus-fixture.h | 2 | ||||
-rw-r--r-- | tests/backend-dbus/mock-end-session-dialog.cc | 2 | ||||
-rw-r--r-- | tests/backend-dbus/mock-lomiri-session.cc (renamed from tests/backend-dbus/mock-unity-session.cc) | 32 | ||||
-rw-r--r-- | tests/backend-dbus/mock-lomiri-session.h (renamed from tests/backend-dbus/mock-unity-session.h) | 20 | ||||
-rw-r--r-- | tests/backend-dbus/test-actions.cc | 36 |
6 files changed, 48 insertions, 48 deletions
diff --git a/tests/backend-dbus/CMakeLists.txt b/tests/backend-dbus/CMakeLists.txt index 92d5a02..393fc13 100644 --- a/tests/backend-dbus/CMakeLists.txt +++ b/tests/backend-dbus/CMakeLists.txt @@ -14,8 +14,8 @@ add_library (desktopmock STATIC mock-object.h mock-screen-saver.cc mock-screen-saver.h - mock-unity-session.cc - mock-unity-session.h + mock-lomiri-session.cc + mock-lomiri-session.h mock-session-manager.cc mock-session-manager.h mock-user.cc diff --git a/tests/backend-dbus/gtest-mock-dbus-fixture.h b/tests/backend-dbus/gtest-mock-dbus-fixture.h index 16b4648..df5bc82 100644 --- a/tests/backend-dbus/gtest-mock-dbus-fixture.h +++ b/tests/backend-dbus/gtest-mock-dbus-fixture.h @@ -25,7 +25,7 @@ #include "mock-display-manager-seat.h" #include "mock-end-session-dialog.h" #include "mock-screen-saver.h" -#include "mock-unity-session.h" +#include "mock-lomiri-session.h" #include "mock-session-manager.h" #include "mock-user.h" #include "mock-webcredentials.h" diff --git a/tests/backend-dbus/mock-end-session-dialog.cc b/tests/backend-dbus/mock-end-session-dialog.cc index 5e8797f..3134dd5 100644 --- a/tests/backend-dbus/mock-end-session-dialog.cc +++ b/tests/backend-dbus/mock-end-session-dialog.cc @@ -39,7 +39,7 @@ MockEndSessionDialog :: handle_open (EndSessionDialog * object, namespace { - const char * const MY_NAME = "org.ayatana.Desktop"; + const char * const MY_NAME = "com.lomiri.Shell"; const char * const MY_PATH = "/org/gnome/SessionManager/EndSessionDialog"; } diff --git a/tests/backend-dbus/mock-unity-session.cc b/tests/backend-dbus/mock-lomiri-session.cc index 8bc06a3..dd3fec5 100644 --- a/tests/backend-dbus/mock-unity-session.cc +++ b/tests/backend-dbus/mock-lomiri-session.cc @@ -17,36 +17,36 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "mock-unity-session.h" +#include "mock-lomiri-session.h" gboolean -MockUnitySession :: handle_lock (DesktopSession * us, +MockLomiriSession :: handle_lock (LomiriShellSession * us, GDBusMethodInvocation * inv, gpointer gself) { - static_cast<MockUnitySession*>(gself)->my_last_action = Lock; - desktop_session_complete_lock (us, inv); + static_cast<MockLomiriSession*>(gself)->my_last_action = Lock; + lomiri_shell_session_complete_lock (us, inv); return true; } gboolean -MockUnitySession :: handle_prompt_lock (DesktopSession * us, +MockLomiriSession :: handle_prompt_lock (LomiriShellSession * us, GDBusMethodInvocation * inv, gpointer gself) { - static_cast<MockUnitySession*>(gself)->my_last_action = PromptLock; - desktop_session_complete_prompt_lock (us, inv); + static_cast<MockLomiriSession*>(gself)->my_last_action = PromptLock; + lomiri_shell_session_complete_prompt_lock (us, inv); return true; } gboolean -MockUnitySession :: handle_request_logout (DesktopSession * us, +MockLomiriSession :: handle_request_logout (LomiriShellSession * us, GDBusMethodInvocation * inv, gpointer gself) { - static_cast<MockUnitySession*>(gself)->my_last_action = RequestLogout; - desktop_session_complete_request_logout (us, inv); + static_cast<MockLomiriSession*>(gself)->my_last_action = RequestLogout; + lomiri_shell_session_complete_request_logout (us, inv); return true; } @@ -56,15 +56,15 @@ MockUnitySession :: handle_request_logout (DesktopSession * us, namespace { - const char * const UNITY_SESSION_NAME = "org.ayatana.Desktop"; - const char * const UNITY_SESSION_PATH = "/org/ayatana/Desktop/Session"; + const char * const LOMIRI_SESSION_NAME = "com.lomiri.Shell"; + const char * const LOMIRI_SESSION_PATH = "/com/lomiri/Shell/Session"; } -MockUnitySession :: MockUnitySession (GMainLoop * loop, +MockLomiriSession :: MockLomiriSession (GMainLoop * loop, GDBusConnection * bus_connection): - MockObject (loop, bus_connection, UNITY_SESSION_NAME, UNITY_SESSION_PATH), - my_skeleton (desktop_session_skeleton_new ()), + MockObject (loop, bus_connection, LOMIRI_SESSION_NAME, LOMIRI_SESSION_PATH), + my_skeleton (lomiri_shell_session_skeleton_new ()), my_last_action (None) { g_signal_connect (my_skeleton, "handle-lock", @@ -77,7 +77,7 @@ MockUnitySession :: MockUnitySession (GMainLoop * loop, set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton)); } -MockUnitySession :: ~MockUnitySession () +MockLomiriSession :: ~MockLomiriSession () { g_clear_object (&my_skeleton); } diff --git a/tests/backend-dbus/mock-unity-session.h b/tests/backend-dbus/mock-lomiri-session.h index 890f2ac..1f42f49 100644 --- a/tests/backend-dbus/mock-unity-session.h +++ b/tests/backend-dbus/mock-lomiri-session.h @@ -17,19 +17,19 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef MOCK_UNITY_SESSION_H -#define MOCK_UNITY_SESSION_H +#ifndef MOCK_LOMIRI_SESSION_H +#define MOCK_LOMIRI_SESSION_H #include "mock-object.h" // parent class -#include "backend-dbus/desktop-session.h" // Desktop Session +#include "backend-dbus/lomiri-session.h" // Lomiri Session -class MockUnitySession: public MockObject +class MockLomiriSession: public MockObject { public: - MockUnitySession (GMainLoop * loop, + MockLomiriSession (GMainLoop * loop, GDBusConnection * bus_connection); - virtual ~MockUnitySession (); + virtual ~MockLomiriSession (); public: @@ -39,16 +39,16 @@ class MockUnitySession: public MockObject private: - DesktopSession * my_skeleton; + LomiriShellSession * my_skeleton; Action my_last_action; - static gboolean handle_lock (DesktopSession *, + static gboolean handle_lock (LomiriShellSession *, GDBusMethodInvocation *, gpointer); - static gboolean handle_prompt_lock (DesktopSession *, + static gboolean handle_prompt_lock (LomiriShellSession *, GDBusMethodInvocation *, gpointer); - static gboolean handle_request_logout (DesktopSession *, + static gboolean handle_request_logout (LomiriShellSession *, GDBusMethodInvocation *, gpointer); diff --git a/tests/backend-dbus/test-actions.cc b/tests/backend-dbus/test-actions.cc index 709273a..bced3e9 100644 --- a/tests/backend-dbus/test-actions.cc +++ b/tests/backend-dbus/test-actions.cc @@ -263,10 +263,10 @@ TEST_F (Actions, PowerOff) g_settings_reset (indicator_settings, SUPPRESS_KEY); } -TEST_F (Actions, LogoutUnity) +TEST_F (Actions, LogoutLomiri) { - MockUnitySession desktop_session(loop, conn); - ASSERT_EQ (MockUnitySession::None, desktop_session.last_action()); + MockLomiriSession lomiri_session(loop, conn); + ASSERT_EQ (MockLomiriSession::None, lomiri_session.last_action()); wait_msec(); // confirm that user is prompted @@ -276,7 +276,7 @@ TEST_F (Actions, LogoutUnity) ASSERT_TRUE (end_session_dialog->is_open()); end_session_dialog->cancel(); wait_msec (50); - ASSERT_EQ (MockUnitySession::None, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::None, lomiri_session.last_action()); // confirm that user is prompted // and that logout is called when user confirms the logout dialog @@ -285,19 +285,19 @@ TEST_F (Actions, LogoutUnity) ASSERT_TRUE (end_session_dialog->is_open ()); end_session_dialog->confirm_logout (); wait_msec (100); - ASSERT_EQ (MockUnitySession::RequestLogout, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::RequestLogout, lomiri_session.last_action()); // confirm that we try to call SessionManager::LogoutQuet // when prompts are disabled login1_manager->clear_last_action (); - desktop_session.clear_last_action (); + lomiri_session.clear_last_action (); ASSERT_EQ ("", login1_manager->last_action()); - ASSERT_EQ (MockUnitySession::None, desktop_session.last_action ()); + ASSERT_EQ (MockLomiriSession::None, lomiri_session.last_action ()); g_settings_set_boolean (indicator_settings, SUPPRESS_KEY, TRUE); wait_msec (50); indicator_session_actions_logout (actions); wait_msec (50); - ASSERT_EQ (MockUnitySession::RequestLogout, desktop_session.last_action ()); + ASSERT_EQ (MockLomiriSession::RequestLogout, lomiri_session.last_action ()); g_settings_reset (indicator_settings, SUPPRESS_KEY); } @@ -356,29 +356,29 @@ TEST_F (Actions, Hibernate) TEST_F (Actions, SwitchToScreensaver) { - MockUnitySession desktop_session(loop, conn); + MockLomiriSession lomiri_session(loop, conn); - ASSERT_EQ (MockUnitySession::None, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::None, lomiri_session.last_action()); indicator_session_actions_switch_to_screensaver (actions); wait_msec (50); - ASSERT_EQ (MockUnitySession::Lock, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::Lock, lomiri_session.last_action()); } TEST_F (Actions, SwitchToGreeter) { - MockUnitySession desktop_session(loop, conn); + MockLomiriSession lomiri_session(loop, conn); ASSERT_NE (MockDisplayManagerSeat::GREETER, dm_seat->last_action()); - ASSERT_EQ (MockUnitySession::None, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::None, lomiri_session.last_action()); indicator_session_actions_switch_to_greeter (actions); wait_msec (50); - ASSERT_EQ (MockUnitySession::PromptLock, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::PromptLock, lomiri_session.last_action()); ASSERT_EQ (MockDisplayManagerSeat::GREETER, dm_seat->last_action()); } TEST_F (Actions, SwitchToGuest) { - MockUnitySession desktop_session(loop, conn); + MockLomiriSession lomiri_session(loop, conn); // allow guests dm_seat->set_guest_allowed (true); @@ -394,12 +394,12 @@ TEST_F (Actions, SwitchToGuest) wait_for_signal (login1_seat->skeleton(), "notify::active-session"); ASSERT_EQ (guest_session_tag, login1_seat->active_session()); wait_msec (50); - ASSERT_EQ (MockUnitySession::PromptLock, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::PromptLock, lomiri_session.last_action()); } TEST_F (Actions, SwitchToUsername) { - MockUnitySession desktop_session(loop, conn); + MockLomiriSession lomiri_session(loop, conn); const char * const dr1_username = "whartnell"; const char * const dr2_username = "ptroughton"; MockUser * dr1_user; @@ -417,7 +417,7 @@ TEST_F (Actions, SwitchToUsername) wait_for_signal (login1_seat->skeleton(), "notify::active-session"); ASSERT_EQ (dr1_session, login1_seat->active_session()); wait_msec (50); - ASSERT_EQ (MockUnitySession::PromptLock, desktop_session.last_action()); + ASSERT_EQ (MockLomiriSession::PromptLock, lomiri_session.last_action()); indicator_session_actions_switch_to_username (actions, dr2_username); wait_for_signal (login1_seat->skeleton(), "notify::active-session"); |