Chromium Code Reviews| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace autofill { | 33 namespace autofill { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 const base::FilePath::CharType kTestName[] = FILE_PATH_LITERAL("heuristics"); | 36 const base::FilePath::CharType kTestName[] = FILE_PATH_LITERAL("heuristics"); |
| 37 | 37 |
| 38 // Convert the |html| snippet to a data URI. | 38 // Convert the |html| snippet to a data URI. |
| 39 GURL HTMLToDataURI(const std::string& html) { | 39 GURL HTMLToDataURI(const std::string& html) { |
| 40 // GURL requires data URLs to be UTF-8 and will fail below if it's not. | 40 // GURL requires data URLs to be UTF-8 and will fail below if it's not. |
| 41 CHECK(base::IsStringUTF8(html)) << "Input file is not UTF-8."; | 41 // Input file is not UTF-8. |
|
vabr (Chromium)
2016/12/09 08:29:12
This comment does not make sense. Thanks to the Is
| |
| 42 CHECK(base::IsStringUTF8(html)); | |
| 42 return GURL(std::string("data:text/html;charset=utf-8,") + html); | 43 return GURL(std::string("data:text/html;charset=utf-8,") + html); |
| 43 } | 44 } |
| 44 | 45 |
| 45 const base::FilePath& GetTestDataDir() { | 46 const base::FilePath& GetTestDataDir() { |
| 46 CR_DEFINE_STATIC_LOCAL(base::FilePath, dir, ()); | 47 CR_DEFINE_STATIC_LOCAL(base::FilePath, dir, ()); |
| 47 if (dir.empty()) | 48 if (dir.empty()) |
| 48 PathService::Get(chrome::DIR_TEST_DATA, &dir); | 49 PathService::Get(chrome::DIR_TEST_DATA, &dir); |
| 49 return dir; | 50 return dir; |
| 50 } | 51 } |
| 51 | 52 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 // Prints the path of the test to be executed. | 147 // Prints the path of the test to be executed. |
| 147 LOG(INFO) << GetParam().MaybeAsASCII(); | 148 LOG(INFO) << GetParam().MaybeAsASCII(); |
| 148 RunOneDataDrivenTest(GetParam(), GetOutputDirectory(kTestName)); | 149 RunOneDataDrivenTest(GetParam(), GetOutputDirectory(kTestName)); |
| 149 } | 150 } |
| 150 | 151 |
| 151 INSTANTIATE_TEST_CASE_P(AllForms, | 152 INSTANTIATE_TEST_CASE_P(AllForms, |
| 152 FormStructureBrowserTest, | 153 FormStructureBrowserTest, |
| 153 testing::ValuesIn(GetTestFiles())); | 154 testing::ValuesIn(GetTestFiles())); |
| 154 | 155 |
| 155 } // namespace autofill | 156 } // namespace autofill |
| OLD | NEW |