| OLD | NEW |
| 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 "components/autofill/core/browser/data_driven_test.h" | 5 #include "components/autofill/core/browser/data_driven_test.h" |
| 6 | 6 |
| 7 #include "base/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 for (base::FilePath input_file = input_files.Next(); | 45 for (base::FilePath input_file = input_files.Next(); |
| 46 !input_file.empty(); | 46 !input_file.empty(); |
| 47 input_file = input_files.Next()) { | 47 input_file = input_files.Next()) { |
| 48 RunOneDataDrivenTest(input_file, output_directory); | 48 RunOneDataDrivenTest(input_file, output_directory); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 void DataDrivenTest::RunOneDataDrivenTest( | 52 void DataDrivenTest::RunOneDataDrivenTest( |
| 53 const base::FilePath& test_file_name, | 53 const base::FilePath& test_file_name, |
| 54 const base::FilePath& output_directory) { | 54 const base::FilePath& output_directory) { |
| 55 // iOS doesn't get rid of removed test files. TODO(estade): remove this after |
| 56 // all iOS bots are clobbered. |
| 57 if (test_file_name.BaseName().value() == FILE_PATH_LITERAL("multimerge.in")) |
| 58 return; |
| 59 |
| 55 ASSERT_TRUE(base::DirectoryExists(output_directory)); | 60 ASSERT_TRUE(base::DirectoryExists(output_directory)); |
| 56 SCOPED_TRACE(test_file_name.BaseName().value()); | 61 SCOPED_TRACE(test_file_name.BaseName().value()); |
| 57 | 62 |
| 58 std::string input; | 63 std::string input; |
| 59 ReadFile(test_file_name, &input); | 64 ReadFile(test_file_name, &input); |
| 60 | 65 |
| 61 std::string output; | 66 std::string output; |
| 62 GenerateResults(input, &output); | 67 GenerateResults(input, &output); |
| 63 | 68 |
| 64 base::FilePath output_file = output_directory.Append( | 69 base::FilePath output_file = output_directory.Append( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 91 } | 96 } |
| 92 | 97 |
| 93 DataDrivenTest::DataDrivenTest(const base::FilePath& test_data_directory) | 98 DataDrivenTest::DataDrivenTest(const base::FilePath& test_data_directory) |
| 94 : test_data_directory_(test_data_directory) { | 99 : test_data_directory_(test_data_directory) { |
| 95 } | 100 } |
| 96 | 101 |
| 97 DataDrivenTest::~DataDrivenTest() { | 102 DataDrivenTest::~DataDrivenTest() { |
| 98 } | 103 } |
| 99 | 104 |
| 100 } // namespace autofill | 105 } // namespace autofill |
| OLD | NEW |