Commit e690c9cd authored by Tonko Sabolčec's avatar Tonko Sabolčec Committed by Commit Bot

[Password Manager] Enable DeleteUndecyrptableLogins feature

Bug: 791541
Change-Id: Ibf11c698d40b29299510f73e8a6b308c618d506b
Reviewed-on: https://chromium-review.googlesource.com/1178284Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Tonko Sabolčec <tsabolcec@google.com>
Cr-Commit-Position: refs/heads/master@{#584045}
parent 6fd575e1
...@@ -236,6 +236,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionsInBoth) { ...@@ -236,6 +236,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionsInBoth) {
autofill::PasswordForm new_from_sync = autofill::PasswordForm new_from_sync =
PasswordFromSpecifics(GetPasswordSpecifics(list.back())); PasswordFromSpecifics(GetPasswordSpecifics(list.back()));
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form)); .WillOnce(AppendForm(form));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -255,6 +257,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionOnlyInSync) { ...@@ -255,6 +257,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionOnlyInSync) {
autofill::PasswordForm new_from_sync = autofill::PasswordForm new_from_sync =
PasswordFromSpecifics(GetPasswordSpecifics(list.back())); PasswordFromSpecifics(GetPasswordSpecifics(list.back()));
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(Return(true)); .WillOnce(Return(true));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -277,6 +281,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionOnlyInPasswordStore) { ...@@ -277,6 +281,8 @@ TEST_F(PasswordSyncableServiceTest, AdditionOnlyInPasswordStore) {
form.federation_origin = url::Origin::Create(GURL(kFederationUrl)); form.federation_origin = url::Origin::Create(GURL(kFederationUrl));
form.username_value = base::ASCIIToUTF16(kUsername); form.username_value = base::ASCIIToUTF16(kUsername);
form.password_value = base::ASCIIToUTF16(kPassword); form.password_value = base::ASCIIToUTF16(kPassword);
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form)); .WillOnce(AppendForm(form));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -297,6 +303,8 @@ TEST_F(PasswordSyncableServiceTest, BothInSync) { ...@@ -297,6 +303,8 @@ TEST_F(PasswordSyncableServiceTest, BothInSync) {
form.type = kArbitraryType; form.type = kArbitraryType;
form.username_value = base::ASCIIToUTF16(kUsername); form.username_value = base::ASCIIToUTF16(kUsername);
form.password_value = base::ASCIIToUTF16(kPassword); form.password_value = base::ASCIIToUTF16(kPassword);
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form)); .WillOnce(AppendForm(form));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -321,6 +329,8 @@ TEST_F(PasswordSyncableServiceTest, Merge) { ...@@ -321,6 +329,8 @@ TEST_F(PasswordSyncableServiceTest, Merge) {
autofill::PasswordForm form2(form1); autofill::PasswordForm form2(form1);
form2.preferred = false; form2.preferred = false;
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form1)); .WillOnce(AppendForm(form1));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -338,6 +348,8 @@ TEST_F(PasswordSyncableServiceTest, PasswordStoreChanges) { ...@@ -338,6 +348,8 @@ TEST_F(PasswordSyncableServiceTest, PasswordStoreChanges) {
// MergeDataAndStartSyncing(). // MergeDataAndStartSyncing().
MockSyncChangeProcessor& weak_processor = *processor_; MockSyncChangeProcessor& weak_processor = *processor_;
EXPECT_CALL(weak_processor, ProcessSyncChanges(_, IsEmpty())); EXPECT_CALL(weak_processor, ProcessSyncChanges(_, IsEmpty()));
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(Return(true)); .WillOnce(Return(true));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)) EXPECT_CALL(*password_store(), FillBlacklistLogins(_))
...@@ -446,6 +458,8 @@ TEST_F(PasswordSyncableServiceTest, MergeDataAndPushBack) { ...@@ -446,6 +458,8 @@ TEST_F(PasswordSyncableServiceTest, MergeDataAndPushBack) {
form2.action = GURL("http://bar.com"); form2.action = GURL("http://bar.com");
form2.username_value = base::ASCIIToUTF16(kUsername); form2.username_value = base::ASCIIToUTF16(kUsername);
form2.password_value = base::ASCIIToUTF16(kPassword); form2.password_value = base::ASCIIToUTF16(kPassword);
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form1)); .WillOnce(AppendForm(form1));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
...@@ -494,6 +508,8 @@ TEST_F(PasswordSyncableServiceTest, FailedReadFromPasswordStore) { ...@@ -494,6 +508,8 @@ TEST_F(PasswordSyncableServiceTest, FailedReadFromPasswordStore) {
syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR, syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
"Failed to get passwords from store.", "Failed to get passwords from store.",
syncer::PASSWORDS); syncer::PASSWORDS);
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(Return(false)); .WillOnce(Return(false));
EXPECT_CALL(*error_factory, CreateAndUploadError(_, _)) EXPECT_CALL(*error_factory, CreateAndUploadError(_, _))
...@@ -583,6 +599,8 @@ TEST_F(PasswordSyncableServiceTest, FailedProcessSyncChanges) { ...@@ -583,6 +599,8 @@ TEST_F(PasswordSyncableServiceTest, FailedProcessSyncChanges) {
new syncer::SyncErrorFactoryMock); new syncer::SyncErrorFactoryMock);
syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR, syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
"There is a problem", syncer::PASSWORDS); "There is a problem", syncer::PASSWORDS);
EXPECT_CALL(*password_store(), DeleteUndecryptableLogins())
.WillOnce(Return(DatabaseCleanupResult::kSuccess));
EXPECT_CALL(*password_store(), FillAutofillableLogins(_)) EXPECT_CALL(*password_store(), FillAutofillableLogins(_))
.WillOnce(AppendForm(form)); .WillOnce(AppendForm(form));
EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store(), FillBlacklistLogins(_)).WillOnce(Return(true));
......
...@@ -22,7 +22,7 @@ const base::Feature kAutofillHome = {"AutofillHome", ...@@ -22,7 +22,7 @@ const base::Feature kAutofillHome = {"AutofillHome",
// Deletes entries from local database on Mac which cannot be decrypted when // Deletes entries from local database on Mac which cannot be decrypted when
// merging data with Sync. // merging data with Sync.
const base::Feature kDeleteUndecryptableLogins = { const base::Feature kDeleteUndecryptableLogins = {
"DeleteUndecryptableLogins", base::FEATURE_DISABLED_BY_DEFAULT}; "DeleteUndecryptableLogins", base::FEATURE_ENABLED_BY_DEFAULT};
// Use HTML based username detector. // Use HTML based username detector.
const base::Feature kHtmlBasedUsernameDetector = { const base::Feature kHtmlBasedUsernameDetector = {
......
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