summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2013-08-26 11:16:00 -0400
committerMichael Terry <michael.terry@canonical.com>2013-08-26 11:16:00 -0400
commit737cd0db40551bccc4e4c30b58f7bb9ce503935a (patch)
tree3119e760e665f8d84408dee471eb5c7565182655 /tests
parenta4fadeff25448b95c3998fec624074cbba18f453 (diff)
downloadlightdm-737cd0db40551bccc4e4c30b58f7bb9ce503935a.tar.gz
Add test for set-next-session
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/scripts/unity-compositor-next-session.conf56
-rw-r--r--tests/src/unity-system-compositor.c6
-rwxr-xr-xtests/test-unity-compositor-next-session2
4 files changed, 64 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b4a1832d..2c1bfddc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -148,6 +148,7 @@ TESTS = \
test-unity-compositor-command \
test-unity-compositor-fail-start \
test-unity-compositor-fail-ready \
+ test-unity-compositor-next-session \
test-unity-autologin \
test-unity-login \
test-unity-switch \
diff --git a/tests/scripts/unity-compositor-next-session.conf b/tests/scripts/unity-compositor-next-session.conf
new file mode 100644
index 00000000..d3771db6
--- /dev/null
+++ b/tests/scripts/unity-compositor-next-session.conf
@@ -0,0 +1,56 @@
+#
+# Check that we correctly set next session when switching selected greeter user
+#
+
+[SeatDefaults]
+type=unity
+user-session=default
+autologin-user=have-password2
+autologin-in-background=true
+
+#?RUNNER DAEMON-START
+
+# System compositor
+#?UNITY-SYSTEM-COMPOSITOR START VT=7 XDG_VTNR=7
+#?*UNITY-SYSTEM-COMPOSITOR READY
+
+# Greeter session
+#?XSERVER-0 START MIR-ID=0
+#?*XSERVER-0 INDICATE-READY
+#?XSERVER-0 INDICATE-READY
+#?XSERVER-0 ACCEPT-CONNECT
+#?GREETER-X-0 START XDG_SEAT=seat0 XDG_VTNR=7
+#?XSERVER-0 ACCEPT-CONNECT
+#?GREETER-X-0 CONNECT-XSERVER
+#?GREETER-X-0 CONNECT-TO-DAEMON
+#?GREETER-X-0 CONNECTED-TO-DAEMON
+
+# Background session
+#?XSERVER-1 START MIR-ID=1
+#?*XSERVER-1 INDICATE-READY
+#?XSERVER-1 INDICATE-READY
+#?XSERVER-1 ACCEPT-CONNECT
+#?SESSION-X-1 START XDG_SEAT=seat0 XDG_VTNR=7 USER=have-password2
+#?XSERVER-1 ACCEPT-CONNECT
+#?SESSION-X-1 CONNECT-XSERVER
+
+# System compositor switches to greeter
+#?UNITY-SYSTEM-COMPOSITOR SET-ACTIVE-SESSION ID=0
+
+# Switch to user without a session
+#?*GREETER-X-0 AUTHENTICATE USERNAME=have-password1
+#?GREETER-X-0 SHOW-PROMPT TEXT="Password:"
+
+# Switch to user with a session
+#?*GREETER-X-0 AUTHENTICATE USERNAME=have-password2
+#?GREETER-X-0 SHOW-PROMPT TEXT="Password:"
+#?UNITY-SYSTEM-COMPOSITOR SET-NEXT-SESSION ID=1
+
+# Cleanup
+#?*STOP-DAEMON
+#?GREETER-X-0 TERMINATE SIGNAL=15
+#?XSERVER-0 TERMINATE SIGNAL=15
+#?XSERVER-1 TERMINATE SIGNAL=15
+#?SESSION-X-1 TERMINATE SIGNAL=15
+#?UNITY-SYSTEM-COMPOSITOR TERMINATE SIGNAL=15
+#?RUNNER DAEMON-EXIT STATUS=0
diff --git a/tests/src/unity-system-compositor.c b/tests/src/unity-system-compositor.c
index 2f8e42cd..9479f544 100644
--- a/tests/src/unity-system-compositor.c
+++ b/tests/src/unity-system-compositor.c
@@ -42,7 +42,8 @@ typedef enum
USC_MESSAGE_PONG = 1,
USC_MESSAGE_READY = 2,
USC_MESSAGE_SESSION_CONNECTED = 3,
- USC_MESSAGE_SET_ACTIVE_SESSION = 4
+ USC_MESSAGE_SET_ACTIVE_SESSION = 4,
+ USC_MESSAGE_SET_NEXT_SESSION = 5,
} USCMessageID;
static void
@@ -103,6 +104,9 @@ read_message_cb (GIOChannel *channel, GIOCondition condition, gpointer data)
case USC_MESSAGE_SET_ACTIVE_SESSION:
status_notify ("UNITY-SYSTEM-COMPOSITOR SET-ACTIVE-SESSION ID=%s", (gchar *)payload);
break;
+ case USC_MESSAGE_SET_NEXT_SESSION:
+ status_notify ("UNITY-SYSTEM-COMPOSITOR SET-NEXT-SESSION ID=%s", (gchar *)payload);
+ break;
default:
g_printerr ("Ignoring message %d with %d octets\n", id, payload_length);
break;
diff --git a/tests/test-unity-compositor-next-session b/tests/test-unity-compositor-next-session
new file mode 100755
index 00000000..730c9ae4
--- /dev/null
+++ b/tests/test-unity-compositor-next-session
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner unity-compositor-next-session test-gobject-greeter