]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
add test that makes sure we list keyboard variants as well as layouts
authorMichael Terry <michael.terry@canonical.com>
Tue, 7 Feb 2012 15:45:30 +0000 (10:45 -0500)
committerMichael Terry <michael.terry@canonical.com>
Tue, 7 Feb 2012 15:45:30 +0000 (10:45 -0500)
tests/Makefile.am
tests/scripts/keyboard-variants.conf [new file with mode: 0644]
tests/src/test-gobject-greeter.c
tests/test-keyboard-variants [new file with mode: 0755]

index 8a3d9c899cf822d8cb927a525b1f157354ab3851..6779cdd4e5b9dffd6da9df2f3780c3176c42cd94 100644 (file)
@@ -19,6 +19,8 @@ TESTS = \
        test-autologin-guest-logout \
        test-keyboard-layout \
        test-no-keyboard-layout \
+       test-default-keyboard-layout \
+       test-keyboard-variants \
        test-language \
        test-no-language \
        test-language-no-accounts-service \
diff --git a/tests/scripts/keyboard-variants.conf b/tests/scripts/keyboard-variants.conf
new file mode 100644 (file)
index 0000000..43115ca
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# Check returns variants as well as normal layouts
+#
+
+[LightDM]
+minimum-display-number=50
+
+[test-greeter-config]
+log-keyboard-layouts=fr
+
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER :50 START
+#?XSERVER :50 INDICATE-READY
+
+# LightDM connects to X server
+#?XSERVER :50 ACCEPT-CONNECT
+
+# Greeter starts
+#?GREETER :50 START
+#?XSERVER :50 ACCEPT-CONNECT
+#?GREETER :50 CONNECT-XSERVER
+#?GREETER :50 CONNECT-TO-DAEMON
+#?GREETER :50 CONNECTED-TO-DAEMON
+
+# Correct layouts are found
+#?XSERVER :50 ACCEPT-CONNECT
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   nodeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   sundeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   oss'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   oss_latin9'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   oss_nodeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   oss_sundeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   latin9'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   latin9_nodeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   latin9_sundeadkeys'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   bepo'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   bepo_latin9'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   dvorak'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   mac'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   bre'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   oci'
+#?GREETER :50 GET-LAYOUTS LAYOUT='fr   geo'
+
+# Cleanup
+#?*STOP-DAEMON
+# Don't know what order they will terminate
+#?(GREETER :50 TERMINATE SIGNAL=15|XSERVER :50 TERMINATE SIGNAL=15)
+#?(GREETER :50 TERMINATE SIGNAL=15|XSERVER :50 TERMINATE SIGNAL=15)
+#?RUNNER DAEMON-EXIT STATUS=0
index 55568013aea7ac99a0c6df78dac3382e5aa17123..0b8526b9eb8154a29986a0f1304a79b54cb62321 100644 (file)
@@ -78,7 +78,7 @@ main (int argc, char **argv)
 {
     GMainLoop *main_loop;
     LightDMGreeter *greeter;
-    gchar *layout_username, *language_username;
+    gchar *layout_username, *language_username, *layout_prefix;
 
     signal (SIGINT, signal_cb);
     signal (SIGTERM, signal_cb);
@@ -143,6 +143,28 @@ main (int argc, char **argv)
         status_notify ("GREETER %s GET-LAYOUT USERNAME=%s LAYOUT='%s'", getenv ("DISPLAY"), layout_username, layout ? layout : "");
     }
 
+    layout_prefix = g_key_file_get_string (config, "test-greeter-config", "log-keyboard-layouts", NULL);
+    if (layout_prefix)
+    {
+        GList *layouts, *iter;
+
+        layouts = lightdm_get_layouts ();
+
+        for (iter = layouts; iter; iter = iter->next)
+        {
+            LightDMLayout *layout;
+            const gchar *name;
+
+            layout = (LightDMLayout *) iter->data;
+            name = lightdm_layout_get_name (layout);
+
+            if (g_str_has_prefix (name, layout_prefix))
+            {
+                status_notify ("GREETER %s GET-LAYOUTS LAYOUT='%s'", getenv ("DISPLAY"), name);
+            }
+        }
+    }
+
     language_username = g_key_file_get_string (config, "test-greeter-config", "log-language", NULL);
     if (language_username)
     {
diff --git a/tests/test-keyboard-variants b/tests/test-keyboard-variants
new file mode 100755 (executable)
index 0000000..7d9742e
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner keyboard-variants test-gobject-greeter