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

Side by Side Diff: components/autofill/core/browser/autofill_merge_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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/feature_list.h"
11 #include "base/files/file_enumerator.h" 12 #include "base/files/file_enumerator.h"
12 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/path_service.h" 15 #include "base/path_service.h"
15 #include "base/strings/string_split.h" 16 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
17 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "components/autofill/core/browser/autofill_experiments.h"
18 #include "components/autofill/core/browser/autofill_test_utils.h" 20 #include "components/autofill/core/browser/autofill_test_utils.h"
19 #include "components/autofill/core/browser/autofill_type.h" 21 #include "components/autofill/core/browser/autofill_type.h"
20 #include "components/autofill/core/browser/country_names.h" 22 #include "components/autofill/core/browser/country_names.h"
21 #include "components/autofill/core/browser/data_driven_test.h" 23 #include "components/autofill/core/browser/data_driven_test.h"
22 #include "components/autofill/core/browser/form_structure.h" 24 #include "components/autofill/core/browser/form_structure.h"
23 #include "components/autofill/core/browser/personal_data_manager.h" 25 #include "components/autofill/core/browser/personal_data_manager.h"
24 #include "components/autofill/core/common/form_data.h" 26 #include "components/autofill/core/common/form_data.h"
25 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
26 #include "url/gurl.h" 28 #include "url/gurl.h"
27 29
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 ServerFieldType field_type = static_cast<ServerFieldType>(i); 192 ServerFieldType field_type = static_cast<ServerFieldType>(i);
191 string_to_field_type_map_[AutofillType(field_type).ToString()] = field_type; 193 string_to_field_type_map_[AutofillType(field_type).ToString()] = field_type;
192 } 194 }
193 } 195 }
194 196
195 AutofillMergeTest::~AutofillMergeTest() { 197 AutofillMergeTest::~AutofillMergeTest() {
196 } 198 }
197 199
198 void AutofillMergeTest::SetUp() { 200 void AutofillMergeTest::SetUp() {
199 test::DisableSystemServices(nullptr); 201 test::DisableSystemServices(nullptr);
202
203 base::FeatureList::ClearInstanceForTesting();
204 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
205 feature_list->InitializeFromCommandLine(kAutofillProfileCleanup.name,
206 std::string());
207 base::FeatureList::SetInstance(std::move(feature_list));
200 } 208 }
201 209
202 void AutofillMergeTest::TearDown() { 210 void AutofillMergeTest::TearDown() {
203 test::ReenableSystemServices(); 211 test::ReenableSystemServices();
204 } 212 }
205 213
206 void AutofillMergeTest::GenerateResults(const std::string& input, 214 void AutofillMergeTest::GenerateResults(const std::string& input,
207 std::string* output) { 215 std::string* output) {
208 MergeProfiles(input, output); 216 MergeProfiles(input, output);
209 } 217 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return string_to_field_type_map_[str]; 287 return string_to_field_type_map_[str];
280 } 288 }
281 289
282 TEST_P(AutofillMergeTest, DataDrivenMergeProfiles) { 290 TEST_P(AutofillMergeTest, DataDrivenMergeProfiles) {
283 RunOneDataDrivenTest(GetParam(), GetOutputDirectory(kTestName)); 291 RunOneDataDrivenTest(GetParam(), GetOutputDirectory(kTestName));
284 } 292 }
285 293
286 INSTANTIATE_TEST_CASE_P(, AutofillMergeTest, testing::ValuesIn(GetTestFiles())); 294 INSTANTIATE_TEST_CASE_P(, AutofillMergeTest, testing::ValuesIn(GetTestFiles()));
287 295
288 } // namespace autofill 296 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_experiments.cc ('k') | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698