From 35cee0064f194ea29f349b41ac47d1868a4c224b Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Wed, 2 Nov 2016 16:38:47 +0000 Subject: Retrieve the session id using dbus if env variable XDG_SESSION_ID is not available. (bzr r4194.4.1) --- tests/test_gnome_session_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_gnome_session_manager.cpp b/tests/test_gnome_session_manager.cpp index b78329884..b7e2c58a2 100644 --- a/tests/test_gnome_session_manager.cpp +++ b/tests/test_gnome_session_manager.cpp @@ -70,6 +70,9 @@ R"( const std::string LOGIND_MANAGER = R"( + + + @@ -186,7 +189,11 @@ struct TestGnomeSessionManager : testing::Test logind_->AddObjects(introspection::LOGIND_MANAGER, LOGIND_MANAGER_PATH); logind_->AddObjects(introspection::LOGIND_SESSION, LOGIND_SESSION_PATH); logind_->GetObjects().front()->SetMethodsCallsHandler([&] (std::string const& method, GVariant*) -> GVariant* { - if (method == "CanSuspend") + if (method == "GetSession") + { + return g_variant_new("(o)", "id0"); + } + else if (method == "CanSuspend") { suspend_called = true; return g_variant_new("(s)", can_suspend_ ? "yes" : "no"); -- cgit v1.2.3