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

Unified Diff: components/autofill/core/browser/personal_data_manager_unittest.cc

Issue 2060223004: [Autofill] Put Autofill Profile Cleanup behing a feature flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ios fix Created 4 years, 6 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/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager_unittest.cc
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index deee27ce5c10984b808879aa3a93d70ac65698e8..f9ab63f8288f7b079d1daf620053e7851378d741 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -11,9 +11,11 @@
#include <map>
#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/command_line.h"
+#include "base/feature_list.h"
#include "base/files/scoped_temp_dir.h"
#include "base/guid.h"
#include "base/metrics/field_trial.h"
@@ -182,6 +184,14 @@ class PersonalDataManagerTest : public testing::Test {
switches::kEnableOfferStoreUnmaskedWalletCards);
}
+ void EnableAutofillProfileCleanup() {
+ base::FeatureList::ClearInstanceForTesting();
+ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
+ feature_list->InitializeFromCommandLine(kAutofillProfileCleanup.name,
+ std::string());
+ base::FeatureList::SetInstance(std::move(feature_list));
+ }
+
void SetupReferenceProfile() {
ASSERT_EQ(0U, personal_data_->GetProfiles().size());
@@ -4391,6 +4401,7 @@ TEST_F(PersonalDataManagerTest, MergeProfile_UsageStats) {
// and that all but the resulting profile gets deleted. Also tests that
// non-similar profiles are not affected by the merge or the delete.
TEST_F(PersonalDataManagerTest, DedupeOnInsert) {
+ EnableAutofillProfileCleanup();
// Create saved profiles.
// Create two very similar profiles that should be deduped. The first one has
// no company name, while the second has one. The second profile also has
@@ -4490,6 +4501,8 @@ TEST_F(PersonalDataManagerTest, DedupeOnInsert) {
// delete after merging similar profiles.
TEST_F(PersonalDataManagerTest,
FindAndMergeDuplicateProfiles_ProfilesToDelete) {
+ EnableAutofillProfileCleanup();
+
// Create the profile for which to find duplicates.
AutofillProfile profile1(base::GenerateGUID(), "https://www.example.com");
test::SetProfileInfo(&profile1, "Homer", "Jay", "Simpson",
@@ -4555,6 +4568,8 @@ TEST_F(PersonalDataManagerTest,
// frecency score.
TEST_F(PersonalDataManagerTest,
FindAndMergeDuplicateProfiles_MergedProfileValues) {
+ EnableAutofillProfileCleanup();
+
// Create a saved profile with a higher frecency score.
AutofillProfile profile1(base::GenerateGUID(), "https://www.example.com");
test::SetProfileInfo(&profile1, "Homer", "Jay", "Simpson",
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698