| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/autofill/autofill_common_test.h" | 11 #include "chrome/browser/autofill/autofill_common_test.h" |
| 12 #include "chrome/browser/autofill/autofill_type.h" | 12 #include "chrome/browser/autofill/autofill_type.h" |
| 13 #include "chrome/browser/autofill/data_driven_test.h" | 13 #include "chrome/browser/autofill/data_driven_test.h" |
| 14 #include "chrome/browser/autofill/form_structure.h" | 14 #include "chrome/browser/autofill/form_structure.h" |
| 15 #include "chrome/browser/autofill/personal_data_manager.h" | 15 #include "chrome/browser/autofill/personal_data_manager.h" |
| 16 #include "chrome/test/base/testing_browser_process_test.h" | |
| 17 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" |
| 20 #include "webkit/glue/form_data.h" | 19 #include "webkit/glue/form_data.h" |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 const FilePath::CharType kTestName[] = FILE_PATH_LITERAL("merge"); | 23 const FilePath::CharType kTestName[] = FILE_PATH_LITERAL("merge"); |
| 25 const FilePath::CharType kFileNamePattern[] = FILE_PATH_LITERAL("*.in"); | 24 const FilePath::CharType kFileNamePattern[] = FILE_PATH_LITERAL("*.in"); |
| 26 | 25 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return profiles_.get(); | 105 return profiles_.get(); |
| 107 } | 106 } |
| 108 | 107 |
| 109 } // namespace | 108 } // namespace |
| 110 | 109 |
| 111 // A data-driven test for verifying merging of Autofill profiles. Each input is | 110 // A data-driven test for verifying merging of Autofill profiles. Each input is |
| 112 // a structured dump of a set of implicitly detected autofill profiles. The | 111 // a structured dump of a set of implicitly detected autofill profiles. The |
| 113 // corresponding output file is a dump of the saved profiles that result from | 112 // corresponding output file is a dump of the saved profiles that result from |
| 114 // importing the input profiles. The output file format is identical to the | 113 // importing the input profiles. The output file format is identical to the |
| 115 // input format. | 114 // input format. |
| 116 class AutofillMergeTest : public TestingBrowserProcessTest, | 115 class AutofillMergeTest : public testing::Test, |
| 117 public DataDrivenTest { | 116 public DataDrivenTest { |
| 118 protected: | 117 protected: |
| 119 AutofillMergeTest(); | 118 AutofillMergeTest(); |
| 120 virtual ~AutofillMergeTest(); | 119 virtual ~AutofillMergeTest(); |
| 121 | 120 |
| 122 // testing::Test: | 121 // testing::Test: |
| 123 virtual void SetUp(); | 122 virtual void SetUp(); |
| 124 | 123 |
| 125 // DataDrivenTest: | 124 // DataDrivenTest: |
| 126 virtual void GenerateResults(const std::string& input, | 125 virtual void GenerateResults(const std::string& input, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 211 } |
| 213 } | 212 } |
| 214 | 213 |
| 215 *merged_profiles = SerializeProfiles(personal_data_->web_profiles()); | 214 *merged_profiles = SerializeProfiles(personal_data_->web_profiles()); |
| 216 } | 215 } |
| 217 | 216 |
| 218 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { | 217 TEST_F(AutofillMergeTest, DataDrivenMergeProfiles) { |
| 219 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), | 218 RunDataDrivenTest(GetInputDirectory(kTestName), GetOutputDirectory(kTestName), |
| 220 kFileNamePattern); | 219 kFileNamePattern); |
| 221 } | 220 } |
| OLD | NEW |