Commit 0a73790a authored by Vadym Doroshenko's avatar Vadym Doroshenko Committed by Commit Bot

Clone parsed submitted form in NewPasswordFormManager::Clone.

Bug: 831123
Change-Id: I299212c75c2dbfa302e31f24313185296067d0d1
Reviewed-on: https://chromium-review.googlesource.com/c/1350183Reviewed-by: default avatarMaxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610817}
parent ff08d3a3
......@@ -477,6 +477,10 @@ std::unique_ptr<NewPasswordFormManager> NewPasswordFormManager::Clone() {
result->parser_.set_predictions(*parser_.predictions());
result->pending_credentials_ = pending_credentials_;
if (parsed_submitted_form_) {
result->parsed_submitted_form_.reset(
new PasswordForm(*parsed_submitted_form_));
}
result->is_new_login_ = is_new_login_;
result->password_overridden_ = password_overridden_;
result->retry_password_form_password_update_ =
......
......@@ -992,6 +992,9 @@ TEST_F(NewPasswordFormManagerTest, Clone) {
EXPECT_EQ(form_manager_->GetPendingCredentials(),
cloned_manager->GetPendingCredentials());
ASSERT_TRUE(cloned_manager->GetSubmittedForm());
EXPECT_EQ(*form_manager_->GetSubmittedForm(),
*cloned_manager->GetSubmittedForm());
}
// Extracts the information whether parsing was successful from a metric
......
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