summaryrefslogtreecommitdiff
path: root/tests
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2016-11-07 23:31:11 +0000
committerBileto Bot <ci-train-bot@canonical.com>2016-11-07 23:31:11 +0000
commit53a3302643ab721c1b6272ec32254442c3a21b82 (patch)
treefc193376db9769b3aec7d9c1b0bbbc38e65da6f0 /tests
parent387d60a3decc0a9f40749898f7eb9855a5f5461b (diff)
parent35cee0064f194ea29f349b41ac47d1868a4c224b (diff)
GnomeSession: Retrieve the session id using dbus if $XDG_SESSION_ID is not set
Approved by: Marco Trevisan (TreviƱo), Martin Pitt (bzr r4204)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_gnome_session_manager.cpp9
1 files changed, 8 insertions, 1 deletions
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"(<node>
const std::string LOGIND_MANAGER =
R"(<node>
<interface name="org.freedesktop.login1.Manager">
+ <method name="GetSession">
+ <arg type="s" name="result" direction="out"/>
+ </method>
<method name="CanSuspend">
<arg type="s" name="result" direction="out"/>
</method>
@@ -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");