on xenial help sign in
revert removal of PIN user from full plugin again as its required for the tests
127756eMichael Zanetti
tests/mocks/LightDM/full/GreeterPrivate.cpp+7−1
@@ -53,6 +53,8 @@ void GreeterPrivate::handleAuthenticate()
53 if (authenticationUser == "no-password") {
53 if (authenticationUser == "no-password") {
54 authenticated = true;
54 authenticated = true;
55 Q_EMIT q->authenticationComplete();
55 Q_EMIT q->authenticationComplete();
56+ } else if (authenticationUser == "has-pin"){
57+ Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
56 } else if (authenticationUser == "auth-error") {
58 } else if (authenticationUser == "auth-error") {
57 authenticated = false;
59 authenticated = false;
58 Q_EMIT q->authenticationComplete();
60 Q_EMIT q->authenticationComplete();
@@ -85,7 +87,11 @@ void GreeterPrivate::handleRespond(const QString &response)
85 return;
87 return;
86 }
88 }
87
89
90+ if (authenticationUser == "has-pin") {
91+ authenticated = (response == "1234");
92+ } else {
88− authenticated = (response == "password");
93+ authenticated = (response == "password");
94+ }
89 Q_EMIT q->authenticationComplete();
95 Q_EMIT q->authenticationComplete();
90}
96}
91
97
tests/mocks/LightDM/full/UsersModelPrivate.cpp+1
@@ -27,6 +27,7 @@ UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
27 entries =
27 entries =
28 {
28 {
29 { "has-password", "Has Password", 0, 0, false, false, 0, 0 },
29 { "has-password", "Has Password", 0, 0, false, false, 0, 0 },
30+ { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
30 { "different-prompt", "Different Prompt", 0, 0, false, false, 0, 0 },
31 { "different-prompt", "Different Prompt", 0, 0, false, false, 0, 0 },
31 { "no-password", "No Password", 0, 0, false, false, 0, 0 },
32 { "no-password", "No Password", 0, 0, false, false, 0, 0 },
32 { "auth-error", "Auth Error", 0, 0, false, false, 0, 0 },
33 { "auth-error", "Auth Error", 0, 0, false, false, 0, 0 },