~ci-train-bot/unity8/unity8-ubuntu-yakkety-landing-055

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_Shell.qml

  • Committer: Bileto Bot
  • Author(s): Michael Terry
  • Date: 2016-07-11 17:23:38 UTC
  • mfrom: (1789.9.15 greeter-focus-true)
  • Revision ID: ci-train-bot@canonical.com-20160711172338-17q0ven6n973k5v8
Fix tablet greeter focus to be always-on, no longer hiding the OSK or forcing a mouse click to type a password.

I've also squeezed some other small fixes in:

- Support Up and Down keys in user list.
- Don't accept non-digit characters when prompting for passcode (we ask OSK to show only digits, but due to bug 1586435, it shows other characters too; plus if the user has an external keyboard, they can type anything anyway).
- When prompting for a passcode in wide-view (tablet/desktop), stop at 4 digits just like we do in narrow-view.
- Don't show "Retry" during brief period before a prompt comes in from PAM.
- Don't let user drag user list if there's only one entry.

Now as for the focus changes...

One of the big reasons we lost keyboard focus before was because we set the shell to disabled whenever the greeter was "between PAM events" -- mostly so that the user can't swipe away greeter before we get our first prompt or are otherwise unsure about exactly what authentication is needed.

But disabled qml items can't be focused.  So I've rejiggered things a bit.  Instead of disabling the whole shell, I just disable the launcher, the indicators, and make the greeter non-swipeable.

I also do some tricks with the prompt so that it looks disabled (while we check with PAM about the password) but isn't actually.  I don't want to make it look to the user that pressing backspace while they wait for PAM does anything, so after the user presses Enter, I present a fake label on top of the prompt that looks like a disabled prompt, while simultaneously hiding the prompt contents. (LP: #1435923)

Show diffs side-by-side

added added

removed removed

Lines of Context:
456
456
        function cleanup() {
457
457
            waitForRendering(shell);
458
458
            mouseEmulation.checked = true;
459
 
            tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
 
459
            tryCompare(shell, "waitingOnGreeter", false); // make sure greeter didn't leave us in disabled state
460
460
            tearDown();
461
461
            WindowStateStorage.clear();
462
462
        }
466
466
            shellLoader.active = true;
467
467
            tryCompare(shellLoader, "status", Loader.Ready);
468
468
            removeTimeConstraintsFromSwipeAreas(shellLoader.item);
469
 
            tryCompare(shell, "enabled", true); // enabled by greeter when ready
 
469
            tryCompare(shell, "waitingOnGreeter", false); // reset by greeter when ready
470
470
 
471
471
            sessionSpy.target = findChild(shell, "greeter")
472
472
            dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
818
818
                tryCompare(userlist, "currentIndex", next)
819
819
                tryCompare(userlist, "movingInternally", false)
820
820
            }
821
 
            tryCompare(shell, "enabled", true); // wait for PAM to settle
 
821
            tryCompare(shell, "waitingOnGreeter", false); // wait for PAM to settle
822
822
        }
823
823
 
824
824
        function selectUser(name) {