Commit c8ff9eac authored by Ossama Mahmoud's avatar Ossama Mahmoud Committed by Commit Bot

OOBE gaia_password_changed submit on enter

This fix allows the user to submit by clicking the enter key after
typing the old password.

Bug: 1110051
Change-Id: I1068dce770926163705c401495a8c145452c55ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550186Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Ossama Mahmoud <osamafathy@google.com>
Cr-Commit-Position: refs/heads/master@{#829664}
parent e6ef5421
......@@ -34,6 +34,7 @@
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/ui/webui/chromeos/login/gaia_password_changed_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chromeos/login/auth/stub_authenticator.h"
#include "chromeos/login/auth/stub_authenticator_builder.h"
#include "chromeos/login/auth/user_context.h"
......@@ -151,6 +152,31 @@ IN_PROC_BROWSER_TEST_F(PasswordChangeTest, MigrateOldCryptohome) {
login_mixin_.WaitForActiveSession();
}
IN_PROC_BROWSER_TEST_F(PasswordChangeTest, SubmitOnEnterKeyPressed) {
OpenGaiaDialog(test_account_id_);
base::HistogramTester histogram_tester;
SetUpStubAuthenticatorAndAttemptLogin("old user password");
WaitForPasswordChangeScreen();
histogram_tester.ExpectBucketCount("Login.PasswordChanged.ReauthReason",
ReauthReason::OTHER, 1);
test::OobeJS().CreateVisibilityWaiter(true, kPasswordStep)->Wait();
// Fill out and submit the old password passed to the stub authenticator.
test::OobeJS().TypeIntoPath("old user password", kOldPasswordInput);
ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
nullptr, ui::VKEY_RETURN, false /* control */, false /* shift */,
false /* alt */, false /* command */));
// User session should start, and whole OOBE screen is expected to be hidden,
OobeWindowVisibilityWaiter(false).Wait();
EXPECT_EQ(StubAuthenticator::DataRecoveryStatus::kRecovered,
data_recovery_status_);
login_mixin_.WaitForActiveSession();
}
IN_PROC_BROWSER_TEST_F(PasswordChangeTest, RetryOnWrongPassword) {
OpenGaiaDialog(test_account_id_);
SetUpStubAuthenticatorAndAttemptLogin("old user password");
......
......@@ -57,6 +57,8 @@ Polymer({
this.initializeLoginScreen('GaiaPasswordChangedScreen', {
resetAllowed: false,
});
this.addSubmitListener(this.$.oldPasswordInput, 'password');
},
/** Initial UI State for screen */
......@@ -89,6 +91,10 @@ Polymer({
chrome.send('migrateUserData', [this.$.oldPasswordInput.value]);
},
onFieldSubmit(id) {
this.submit_();
},
/** @private */
onForgotPasswordClicked_() {
this.setUIStep(UIState.FORGOT);
......
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