Index: components/password_manager/core/browser/password_form_manager_unittest.cc |
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc |
index 1599f444422954a56d38e38a1746d9610d13dfde..3de9ecc86f115a28f737cb22fbe590a15668ca4e 100644 |
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc |
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc |
@@ -687,6 +687,9 @@ TEST_F(PasswordFormManagerTest, TestUpdateIncompleteCredentials) { |
complete_form.username_element = encountered_form.username_element; |
complete_form.submit_element = encountered_form.submit_element; |
+ PasswordForm obsolete_form(*incomplete_form); |
+ obsolete_form.action = encountered_form.action; |
+ |
// Feed the incomplete credentials to the manager. |
std::vector<PasswordForm*> results; |
results.push_back(incomplete_form); // Takes ownership. |
@@ -696,9 +699,11 @@ TEST_F(PasswordFormManagerTest, TestUpdateIncompleteCredentials) { |
complete_form, PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); |
// By now that form has been used once. |
complete_form.times_used = 1; |
+ obsolete_form.times_used = 1; |
// Check that PasswordStore receives an update request with the complete form. |
- EXPECT_CALL(*mock_store(), UpdateLogin(complete_form)); |
+ EXPECT_CALL(*mock_store(), RemoveLogin(obsolete_form)); |
+ EXPECT_CALL(*mock_store(), AddLogin(complete_form)); |
form_manager.Save(); |
} |