on xenial help sign in
revert removal of PIN user from full plugin again as its required for the tests
commit127756e28e2459ea4b4fbc7d0cced2f839006463 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 11 Jun 2013, 12:30 (13 years ago) parentaeaedee
2 files changed+8−1
tests/mocks/LightDM/full/GreeterPrivate.cpp+7−1 tests/mocks/LightDM/full/UsersModelPrivate.cpp+1
tests/mocks/LightDM/full/GreeterPrivate.cpp+7−1
@@ -53,6 +53,8 @@ void GreeterPrivate::handleAuthenticate()
5353 if (authenticationUser == "no-password") {
5454 authenticated = true;
5555 Q_EMIT q->authenticationComplete();
56+ } else if (authenticationUser == "has-pin"){
57+ Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
5658 } else if (authenticationUser == "auth-error") {
5759 authenticated = false;
5860 Q_EMIT q->authenticationComplete();
@@ -85,7 +87,11 @@ void GreeterPrivate::handleRespond(const QString &response)
8587 return;
8688 }
8789
88− authenticated = (response == "password");
90+ if (authenticationUser == "has-pin") {
91+ authenticated = (response == "1234");
92+ } else {
93+ authenticated = (response == "password");
94+ }
8995 Q_EMIT q->authenticationComplete();
9096}
9197
tests/mocks/LightDM/full/UsersModelPrivate.cpp+1
@@ -27,6 +27,7 @@ UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
2727 entries =
2828 {
2929 { "has-password", "Has Password", 0, 0, false, false, 0, 0 },
30+ { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
3031 { "different-prompt", "Different Prompt", 0, 0, false, false, 0, 0 },
3132 { "no-password", "No Password", 0, 0, false, false, 0, 0 },
3233 { "auth-error", "Auth Error", 0, 0, false, false, 0, 0 },