Skip to content

Commit

Permalink
[Password Manager] Update the provisionally saved form when username/…
Browse files Browse the repository at this point in the history
…password was filled

When a user typed the username, but filled the password from the list of saved credentials, the provisionally saved form should be updated. So, the fallback for saving will be updated as well.

Bug: 725883
Change-Id: Iede6e24e1b7e9b0e3b5706f2baff5739bd1fe7ab
Reviewed-on: https://chromium-review.googlesource.com/712040
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508364}
  • Loading branch information
Maxim Kolosovskiy authored and Commit Bot committed Oct 12, 2017
1 parent 0502f56 commit 455aa60
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1286,18 +1286,24 @@ TEST_F(PasswordAutofillAgentTest,
SimulateOnFillPasswordForm(fill_data_);
// Neither field should have been autocompleted.
CheckTextFieldsDOMState("user1", false, std::string(), false);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(0, fake_driver_.called_show_manual_fallback_for_saving_count());

// Only password field should be autocompleted.
EXPECT_TRUE(password_autofill_agent_->FillSuggestion(
password_element_, ASCIIToUTF16(kAliceUsername),
ASCIIToUTF16(kAlicePassword)));
CheckTextFieldsDOMState("user1", false, kAlicePassword, true);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1, fake_driver_.called_show_manual_fallback_for_saving_count());

// Try Filling with a different password. Only password should be changed.
EXPECT_TRUE(password_autofill_agent_->FillSuggestion(
password_element_, ASCIIToUTF16(kBobUsername),
ASCIIToUTF16(kCarolPassword)));
CheckTextFieldsDOMState("user1", false, kCarolPassword, true);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(2, fake_driver_.called_show_manual_fallback_for_saving_count());
}

// Tests that |FillSuggestion| properly fills the password if the username field
Expand Down
Loading

0 comments on commit 455aa60

Please sign in to comment.