From e249218a9db7f89240b4011e148f858a5c5c3072 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 7 Aug 2012 17:52:24 +0200 Subject: [PATCH] Allow testing GDM login dialog from the session Check an environment variable, GDM_GREETER_TEST. If 1, LoginDialog will skip anything that fails outside a GDM session. It is therefore possible to test the GDM greeter without installing it system-wide, by attempting login as the already logged in user (uses the same code path as the unlock dialog). https://bugzilla.gnome.org/show_bug.cgi?id=683725 --- js/gdm/loginDialog.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 7ea93ba6d..15308ddfc 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -638,15 +638,17 @@ const LoginDialog = new Lang.Class({ this._userManager = AccountsService.UserManager.get_default() this._greeterClient = new Gdm.Client(); - this._greeter = this._greeterClient.get_greeter_sync(null); + if (GLib.getenv('GDM_GREETER_TEST') != '1') { + this._greeter = this._greeterClient.get_greeter_sync(null); - this._greeter.connect('default-session-name-changed', - Lang.bind(this, this._onDefaultSessionChanged)); + this._greeter.connect('default-session-name-changed', + Lang.bind(this, this._onDefaultSessionChanged)); - this._greeter.connect('session-opened', - Lang.bind(this, this._onSessionOpened)); - this._greeter.connect('timed-login-requested', - Lang.bind(this, this._onTimedLoginRequested)); + this._greeter.connect('session-opened', + Lang.bind(this, this._onSessionOpened)); + this._greeter.connect('timed-login-requested', + Lang.bind(this, this._onTimedLoginRequested)); + } this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient); this._userVerifier.connect('ask-question', Lang.bind(this, this._askQuestion));