OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // A data-driven test for verifying Autofill heuristics. Each input is an HTML | 41 // A data-driven test for verifying Autofill heuristics. Each input is an HTML |
42 // file that contains one or more forms. The corresponding output file lists the | 42 // file that contains one or more forms. The corresponding output file lists the |
43 // heuristically detected type for eachfield. | 43 // heuristically detected type for eachfield. |
44 class FormStructureBrowserTest : public InProcessBrowserTest, | 44 class FormStructureBrowserTest : public InProcessBrowserTest, |
45 public DataDrivenTest { | 45 public DataDrivenTest { |
46 protected: | 46 protected: |
47 FormStructureBrowserTest(); | 47 FormStructureBrowserTest(); |
48 virtual ~FormStructureBrowserTest(); | 48 virtual ~FormStructureBrowserTest(); |
49 | 49 |
50 // DataDrivenTest: | 50 // DataDrivenTest: |
51 virtual void GenerateResults(const std::string& input, | 51 void GenerateResults(const std::string& input, std::string* output) override; |
52 std::string* output) override; | |
53 | 52 |
54 // Serializes the given |forms| into a string. | 53 // Serializes the given |forms| into a string. |
55 std::string FormStructuresToString(const std::vector<FormStructure*>& forms); | 54 std::string FormStructuresToString(const std::vector<FormStructure*>& forms); |
56 | 55 |
57 private: | 56 private: |
58 DISALLOW_COPY_AND_ASSIGN(FormStructureBrowserTest); | 57 DISALLOW_COPY_AND_ASSIGN(FormStructureBrowserTest); |
59 }; | 58 }; |
60 | 59 |
61 FormStructureBrowserTest::FormStructureBrowserTest() | 60 FormStructureBrowserTest::FormStructureBrowserTest() |
62 : DataDrivenTest(GetTestDataDir()) { | 61 : DataDrivenTest(GetTestDataDir()) { |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 IN_PROC_BROWSER_TEST_F(FormStructureBrowserTest, | 271 IN_PROC_BROWSER_TEST_F(FormStructureBrowserTest, |
273 MAYBE_DataDrivenHeuristics(20)) { | 272 MAYBE_DataDrivenHeuristics(20)) { |
274 const base::FilePath::CharType kFileNamePattern[] = | 273 const base::FilePath::CharType kFileNamePattern[] = |
275 FILE_PATH_LITERAL("20_*.html"); | 274 FILE_PATH_LITERAL("20_*.html"); |
276 RunDataDrivenTest(GetInputDirectory(kTestName), | 275 RunDataDrivenTest(GetInputDirectory(kTestName), |
277 GetOutputDirectory(kTestName), | 276 GetOutputDirectory(kTestName), |
278 kFileNamePattern); | 277 kFileNamePattern); |
279 } | 278 } |
280 | 279 |
281 } // namespace autofill | 280 } // namespace autofill |
OLD | NEW |