summaryrefslogtreecommitdiff
path: root/tests
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2016-11-02 16:38:47 +0000
committerAndrea Azzarone <azzaronea@gmail.com>2016-11-02 16:38:47 +0000
commit35cee0064f194ea29f349b41ac47d1868a4c224b (patch)
tree9ea3081be9b080e25b659442c77b6d6d30aa898e /tests
parenta9418611d57dc618390f9d85632d3ac1803bf78c (diff)
Retrieve the session id using dbus if env variable XDG_SESSION_ID is not available.
(bzr r4194.4.1)
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");