Chromium Code Reviews| 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..78af437997e52eb4adfdf9c6c0b7bfcfea6a20ea 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(); |
|
sebsg
2016/06/14 18:34:15
Please add this line to PersonalDataManagerTest.Fi
|
| // 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", |