From f84be4fd25f04e122f8a68f9ce4f9dc4daead118 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 19 Sep 2015 12:40:42 +0200 Subject: fork unity-greeter as arctica-greeter --- tests/Makefile.am | 24 ++++----- tests/arctica-greeter.vala | 129 +++++++++++++++++++++++++++++++++++++++++++++ tests/test.vala | 54 +++++++++---------- tests/unity-greeter.vala | 129 --------------------------------------------- 4 files changed, 168 insertions(+), 168 deletions(-) create mode 100644 tests/arctica-greeter.vala delete mode 100644 tests/unity-greeter.vala (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 3c04ef2..e2f601d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,16 +1,16 @@ # -*- Mode: Automake; indent-tabs-mode: t; tab-width: 4 -*- -check_PROGRAMS = unity-greeter-test +check_PROGRAMS = arctica-greeter-test -check: unity-greeter-test - UBUNTU_MENUPROXY=0 top_srcdir=$(top_srcdir) . xvfb-run -a ./unity-greeter-test +check: arctica-greeter-test + UBUNTU_MENUPROXY=0 top_srcdir=$(top_srcdir) . xvfb-run -a ./arctica-greeter-test -unity_greeter_test_SOURCES = \ +arctica_greeter_test_SOURCES = \ test.vala \ test-list.vala \ test-main-window.vala \ menubar.vala \ - unity-greeter.vala \ + arctica-greeter.vala \ ../src/flat-button.vala \ ../src/toggle-box.vala \ ../src/user-list.vala \ @@ -39,17 +39,17 @@ unity_greeter_test_SOURCES = \ ../src/shutdown-dialog.vala -unity_greeter_test_CFLAGS = \ - $(UNITY_GREETER_CFLAGS) \ +arctica_greeter_test_CFLAGS = \ + $(ARCTICA_GREETER_CFLAGS) \ -w \ -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ -DLOCALEDIR=\""$(localedir)"\" \ -DVERSION=\"$(VERSION)\" \ - -DCONFIG_FILE=\""$(sysconfdir)/lightdm/unity-greeter.conf"\" \ + -DCONFIG_FILE=\""$(sysconfdir)/lightdm/arctica-greeter.conf"\" \ -DPKGDATADIR=\""$(pkgdatadir)"\" \ -DINDICATORDIR=\""$(INDICATORDIR)"\" -unity_greeter_test_VALAFLAGS = \ +arctica_greeter_test_VALAFLAGS = \ --pkg posix \ --pkg gtk+-3.0 \ --pkg gdk-x11-3.0 \ @@ -61,12 +61,12 @@ unity_greeter_test_VALAFLAGS = \ --pkg pixman-1 \ --target-glib 2.32 -unity_greeter_test_LDADD = \ - $(UNITY_GREETER_LIBS) \ +arctica_greeter_test_LDADD = \ + $(ARCTICA_GREETER_LIBS) \ -lm CLEANFILES = \ - $(notdir $(unity_greeter_test_SOURCES:.vala=.c)) + $(notdir $(arctica_greeter_test_SOURCES:.vala=.c)) DISTCLEANFILES = \ Makefile.in diff --git a/tests/arctica-greeter.vala b/tests/arctica-greeter.vala new file mode 100644 index 0000000..2a6581b --- /dev/null +++ b/tests/arctica-greeter.vala @@ -0,0 +1,129 @@ +/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*- + * + * Copyright (C) 2011 Canonical Ltd + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Authored by: Robert Ancell + */ + +public const int grid_size = 40; + +public class ArcticaGreeter +{ + public static ArcticaGreeter singleton; + + public signal void show_message (string text, LightDM.MessageType type); + public signal void show_prompt (string text, LightDM.PromptType type); + public signal void authentication_complete (); + + public bool test_mode = false; + public bool session_started = false; + public string last_respond_response; + public bool orca_needs_kick; + + public bool is_authenticated () + { + return false; + } + + public void authenticate (string? userid = null) + { + } + + public void authenticate_as_guest () + { + } + + public void authenticate_remote (string? session, string? userid) + { + } + + public void cancel_authentication () + { + } + + public void respond (string response) + { + last_respond_response = response; + } + + public string authentication_user () + { + return ""; + } + + public string default_session_hint () + { + return ""; + } + + public string select_user_hint () + { + return ""; + } + + public bool _show_manual_login_hint = true; + public bool show_manual_login_hint () + { + return _show_manual_login_hint; + } + + public bool _show_remote_login_hint = true; + public bool show_remote_login_hint () + { + return _show_remote_login_hint; + } + + public bool _hide_users_hint = false; + public bool hide_users_hint () + { + return _hide_users_hint; + } + + public bool _has_guest_account_hint = true; + public bool has_guest_account_hint () + { + return _has_guest_account_hint; + } + + public bool start_session (string? session, Background bg) + { + session_started = true; + return true; + } + + public void push_list (GreeterList widget) + { + } + + public void pop_list () + { + } + + public string? get_state (string key) + { + return null; + } + + public void set_state (string key, string value) + { + } + + public static void add_style_class (Gtk.Widget widget) + { + /* Add style context class lightdm-user-list */ + var ctx = widget.get_style_context (); + ctx.add_class ("lightdm"); + } +} diff --git a/tests/test.vala b/tests/test.vala index 8c6e35d..ad495b7 100644 --- a/tests/test.vala +++ b/tests/test.vala @@ -486,11 +486,11 @@ public class Test GLib.assert (list.selected_entry.id == "*remote_login*http://rdpdefaultusername2.com*lwola"); wait_for_scrolling_end (list); - UnityGreeter.singleton.session_started = false; + ArcticaGreeter.singleton.session_started = false; pwd = remote_login_entry_password_field (list); pwd.text = "password"; list.selected_entry.respond ({}); - GLib.assert (UnityGreeter.singleton.session_started); + GLib.assert (ArcticaGreeter.singleton.session_started); mw.hide (); } @@ -516,7 +516,7 @@ public class Test GLib.assert (list.selected_entry.id == "*remote_login*http://rdpdefaultusername2.com*lwola"); wait_for_scrolling_end (list); - UnityGreeter.singleton.session_started = false; + ArcticaGreeter.singleton.session_started = false; pwd = remote_login_entry_password_field (list); pwd.text = "delay"; pwd.activate (); @@ -650,14 +650,14 @@ public class Test username.text = "bar"; pwd.text = "foobar"; - UnityGreeter.singleton.show_prompt("remote login:", LightDM.PromptType.QUESTION); - GLib.assert (UnityGreeter.singleton.last_respond_response == username.text); - UnityGreeter.singleton.show_prompt("remote host:", LightDM.PromptType.QUESTION); - GLib.assert (UnityGreeter.singleton.last_respond_response == "http://coolrdpserver.com"); - UnityGreeter.singleton.show_prompt("domain:", LightDM.PromptType.QUESTION); - GLib.assert (UnityGreeter.singleton.last_respond_response == domain.text); - UnityGreeter.singleton.show_prompt("password:", LightDM.PromptType.SECRET); - GLib.assert (UnityGreeter.singleton.last_respond_response == pwd.text); + ArcticaGreeter.singleton.show_prompt("remote login:", LightDM.PromptType.QUESTION); + GLib.assert (ArcticaGreeter.singleton.last_respond_response == username.text); + ArcticaGreeter.singleton.show_prompt("remote host:", LightDM.PromptType.QUESTION); + GLib.assert (ArcticaGreeter.singleton.last_respond_response == "http://coolrdpserver.com"); + ArcticaGreeter.singleton.show_prompt("domain:", LightDM.PromptType.QUESTION); + GLib.assert (ArcticaGreeter.singleton.last_respond_response == domain.text); + ArcticaGreeter.singleton.show_prompt("password:", LightDM.PromptType.SECRET); + GLib.assert (ArcticaGreeter.singleton.last_respond_response == pwd.text); mw.hide (); } @@ -690,15 +690,15 @@ public class Test public static void remote_login_only () { - UnityGreeter.singleton.test_mode = true; - UnityGreeter.singleton.session_started = false; + ArcticaGreeter.singleton.test_mode = true; + ArcticaGreeter.singleton.session_started = false; /* this configuration should result in the list containing only the remote login entry, without any fallback manual entry */ - UnityGreeter.singleton._hide_users_hint = true; - UnityGreeter.singleton._show_remote_login_hint = true; - UnityGreeter.singleton._has_guest_account_hint = false; - UnityGreeter.singleton._show_manual_login_hint = false; + ArcticaGreeter.singleton._hide_users_hint = true; + ArcticaGreeter.singleton._show_remote_login_hint = true; + ArcticaGreeter.singleton._has_guest_account_hint = false; + ArcticaGreeter.singleton._show_manual_login_hint = false; MainWindow mw = setup (); TestList list = mw.stack.top () as TestList; @@ -725,14 +725,14 @@ public class Test public static void manual_login_fallback () { - UnityGreeter.singleton.test_mode = true; - UnityGreeter.singleton.session_started = false; + ArcticaGreeter.singleton.test_mode = true; + ArcticaGreeter.singleton.session_started = false; /* this configuration should result in the list containing at least a manual entry */ - UnityGreeter.singleton._hide_users_hint = true; - UnityGreeter.singleton._show_remote_login_hint = false; - UnityGreeter.singleton._has_guest_account_hint = false; - UnityGreeter.singleton._show_manual_login_hint = true; + ArcticaGreeter.singleton._hide_users_hint = true; + ArcticaGreeter.singleton._show_remote_login_hint = false; + ArcticaGreeter.singleton._has_guest_account_hint = false; + ArcticaGreeter.singleton._show_manual_login_hint = true; MainWindow mw = setup (); TestList list = mw.stack.top () as TestList; @@ -749,7 +749,7 @@ public class Test { try { - var dir = GLib.DirUtils.make_tmp ("unity-greeter-test-XXXXXX"); + var dir = GLib.DirUtils.make_tmp ("arctica-greeter-test-XXXXXX"); var schema_dir = Path.build_filename(dir, "share", "glib-2.0", "schemas"); DirUtils.create_with_parents(schema_dir, 0700); @@ -760,7 +760,7 @@ public class Test var top_srcdir = Environment.get_variable("top_srcdir"); if (top_srcdir == null || top_srcdir == "") top_srcdir = ".."; - if (Posix.system("cp %s/data/com.canonical.unity-greeter.gschema.xml %s".printf(top_srcdir, schema_dir)) != 0) + if (Posix.system("cp %s/data/org.ArcticaProject.arctica-greeter.gschema.xml %s".printf(top_srcdir, schema_dir)) != 0) error("Could not copy schema to %s", schema_dir); if (Posix.system("glib-compile-schemas %s".printf(schema_dir)) != 0) @@ -780,8 +780,8 @@ public class Test setup_gsettings (); - UnityGreeter.singleton = new UnityGreeter(); - UnityGreeter.singleton.test_mode = true; + ArcticaGreeter.singleton = new ArcticaGreeter(); + ArcticaGreeter.singleton.test_mode = true; GLib.Test.add_func ("/Simple Navigation", simple_navigation); GLib.Test.add_func ("/Remote Login", remote_login); diff --git a/tests/unity-greeter.vala b/tests/unity-greeter.vala deleted file mode 100644 index 15cbb56..0000000 --- a/tests/unity-greeter.vala +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*- - * - * Copyright (C) 2011 Canonical Ltd - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Authored by: Robert Ancell - */ - -public const int grid_size = 40; - -public class UnityGreeter -{ - public static UnityGreeter singleton; - - public signal void show_message (string text, LightDM.MessageType type); - public signal void show_prompt (string text, LightDM.PromptType type); - public signal void authentication_complete (); - - public bool test_mode = false; - public bool session_started = false; - public string last_respond_response; - public bool orca_needs_kick; - - public bool is_authenticated () - { - return false; - } - - public void authenticate (string? userid = null) - { - } - - public void authenticate_as_guest () - { - } - - public void authenticate_remote (string? session, string? userid) - { - } - - public void cancel_authentication () - { - } - - public void respond (string response) - { - last_respond_response = response; - } - - public string authentication_user () - { - return ""; - } - - public string default_session_hint () - { - return ""; - } - - public string select_user_hint () - { - return ""; - } - - public bool _show_manual_login_hint = true; - public bool show_manual_login_hint () - { - return _show_manual_login_hint; - } - - public bool _show_remote_login_hint = true; - public bool show_remote_login_hint () - { - return _show_remote_login_hint; - } - - public bool _hide_users_hint = false; - public bool hide_users_hint () - { - return _hide_users_hint; - } - - public bool _has_guest_account_hint = true; - public bool has_guest_account_hint () - { - return _has_guest_account_hint; - } - - public bool start_session (string? session, Background bg) - { - session_started = true; - return true; - } - - public void push_list (GreeterList widget) - { - } - - public void pop_list () - { - } - - public string? get_state (string key) - { - return null; - } - - public void set_state (string key, string value) - { - } - - public static void add_style_class (Gtk.Widget widget) - { - /* Add style context class lightdm-user-list */ - var ctx = widget.get_style_context (); - ctx.add_class ("lightdm"); - } -} -- cgit v1.2.3