Commit 55c1ed1a authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

settings: Keep focus on lock screen password prompt after wrong password.

Test: browser_tests CrSettingsPeoplePageQuickUnlockAuthenticateTest.*
Bug: 786930
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I658551a326421e94933b071ddc218979b7d8de86
Reviewed-on: https://chromium-review.googlesource.com/792096Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519799}
parent 04f4824d
......@@ -136,6 +136,12 @@ Polymer({
// The password might have been cleared during the duration of the
// getActiveModes call.
this.passwordInvalid_ = !valid && !!this.password_;
// Return focus to the password input if it lost focus while being checked
// (user pressed confirm button).
if (this.passwordInvalid_ &&
this.shadowRoot.activeElement != this.$.passwordInput) {
this.$.passwordInput.focus();
}
if (valid) {
// Create the |this.setModes| closure and automatically clear it after
......
......@@ -90,6 +90,16 @@ cr.define('settings_people_page_quick_unlock', function() {
assertDeepEquals([''], quickUnlockPrivateApi.credentials);
});
test('TapConfirmButtonWithWrongPasswordRestoresFocus', function() {
var confirmButton = getFromElement('#passwordInput');
quickUnlockPrivateApi.accountPassword = 'bar';
passwordElement.value = 'foo';
MockInteractions.tap(
getFromElement('paper-button[class="action-button"]'));
assertEquals(element.shadowRoot.activeElement, passwordElement);
});
// A bad password does not provide an authenticated setModes object, and a
// entered password correctly uma should not be recorded.
test('InvalidPasswordDoesNotProvideAuthentication', function() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment