Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: components/password_manager/core/browser/password_form_manager_unittest.cc

Issue 1315323003: Clean the blacklisted form if a user saves a password. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0da4734143d132a7374909abec54ba07056e549b..876ed1bbb91be328d28c681d1b22bb6170ebbd2f 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -29,9 +29,11 @@
using autofill::PasswordForm;
using base::ASCIIToUTF16;
using ::testing::_;
+using ::testing::ElementsAre;
using ::testing::Eq;
using ::testing::Mock;
using ::testing::NiceMock;
+using ::testing::Pointee;
using ::testing::Return;
using ::testing::SaveArg;
@@ -431,9 +433,15 @@ TEST_F(PasswordFormManagerTest, TestBlacklist) {
form_manager.pending_credentials().signon_realm);
const PasswordForm pending_form = form_manager.pending_credentials();
+ PasswordForm actual_add_form;
EXPECT_CALL(*mock_store(), RemoveLogin(_)).Times(0);
+ EXPECT_CALL(*mock_store(), AddLogin(_))
+ .WillOnce(SaveArg<0>(&actual_add_form));
form_manager.PermanentlyBlacklist();
EXPECT_EQ(pending_form, form_manager.pending_credentials());
+ EXPECT_TRUE(form_manager.IsBlacklisted());
+ EXPECT_THAT(form_manager.blacklisted_matches(),
+ ElementsAre(Pointee(actual_add_form)));
}
TEST_F(PasswordFormManagerTest, AutofillBlacklisted) {
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698