]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
tests: avoid a test race condition when locking seats or sessions over dbus
authorMichael Terry <michael.terry@canonical.com>
Thu, 27 Sep 2012 05:11:26 +0000 (01:11 -0400)
committerMichael Terry <michael.terry@canonical.com>
Thu, 27 Sep 2012 05:11:26 +0000 (01:11 -0400)
tests/src/test-session.c

index 92599dc455323a1e282ff45faee7a18372c5d195..6a3dd79e47cb6957364d42099c97a03727cde3c6 100644 (file)
@@ -44,6 +44,7 @@ request_cb (const gchar *request)
     r = g_strdup_printf ("SESSION %s LOCK-SEAT", getenv ("DISPLAY"));
     if (strcmp (request, r) == 0)
     {
+        status_notify ("SESSION %s LOCK-SEAT", getenv ("DISPLAY"));
         g_dbus_connection_call_sync (g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL),
                                      "org.freedesktop.DisplayManager",
                                      getenv ("XDG_SEAT_PATH"),
@@ -55,13 +56,13 @@ request_cb (const gchar *request)
                                      1000,
                                      NULL,
                                      NULL);
-        status_notify ("SESSION %s LOCK-SEAT", getenv ("DISPLAY"));
     }
     g_free (r);
 
     r = g_strdup_printf ("SESSION %s LOCK-SESSION", getenv ("DISPLAY"));
     if (strcmp (request, r) == 0)
     {
+        status_notify ("SESSION %s LOCK-SESSION", getenv ("DISPLAY"));
         g_dbus_connection_call_sync (g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL),
                                      "org.freedesktop.DisplayManager",
                                      getenv ("XDG_SESSION_PATH"),
@@ -73,7 +74,6 @@ request_cb (const gchar *request)
                                      1000,
                                      NULL,
                                      NULL);
-        status_notify ("SESSION %s LOCK-SESSION", getenv ("DISPLAY"));
     }
     g_free (r);