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 "chrome/test/ui/ui_layout_test.h" | 5 #include "chrome/test/ui/ui_layout_test.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 new_parent_resource_path.AppendASCII("resources"); | 142 new_parent_resource_path.AppendASCII("resources"); |
143 ASSERT_TRUE(file_util::CopyDirectory( | 143 ASSERT_TRUE(file_util::CopyDirectory( |
144 parent_resource_path, new_parent_resource_path, true)); | 144 parent_resource_path, new_parent_resource_path, true)); |
145 } | 145 } |
146 | 146 |
147 // Reads the layout test controller simulation script. | 147 // Reads the layout test controller simulation script. |
148 FilePath path; | 148 FilePath path; |
149 PathService::Get(chrome::DIR_TEST_DATA, &path); | 149 PathService::Get(chrome::DIR_TEST_DATA, &path); |
150 path = path.AppendASCII("layout_tests"); | 150 path = path.AppendASCII("layout_tests"); |
151 path = path.AppendASCII("layout_test_controller.html"); | 151 path = path.AppendASCII("layout_test_controller.html"); |
| 152 layout_test_controller_.clear(); |
152 ASSERT_TRUE(file_util::ReadFileToString(path, &layout_test_controller_)); | 153 ASSERT_TRUE(file_util::ReadFileToString(path, &layout_test_controller_)); |
153 } | 154 } |
154 | 155 |
155 void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir, | 156 void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir, |
156 const FilePath& resource_name) { | 157 const FilePath& resource_name) { |
157 FilePath source = GetLayoutTestRoot(); | 158 FilePath source = GetLayoutTestRoot(); |
158 source = source.Append(parent_dir); | 159 source = source.Append(parent_dir); |
159 source = source.Append(resource_name); | 160 source = source.Append(resource_name); |
160 | 161 |
161 ASSERT_TRUE(file_util::PathExists(source)); | 162 ASSERT_TRUE(file_util::PathExists(source)); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 std::string* expected_result_value) { | 276 std::string* expected_result_value) { |
276 FilePath expected_result_path(result_dir_path); | 277 FilePath expected_result_path(result_dir_path); |
277 expected_result_path = expected_result_path.AppendASCII(test_case_file_name); | 278 expected_result_path = expected_result_path.AppendASCII(test_case_file_name); |
278 expected_result_path = expected_result_path.InsertBeforeExtension( | 279 expected_result_path = expected_result_path.InsertBeforeExtension( |
279 FILE_PATH_LITERAL("-expected")); | 280 FILE_PATH_LITERAL("-expected")); |
280 expected_result_path = | 281 expected_result_path = |
281 expected_result_path.ReplaceExtension(FILE_PATH_LITERAL("txt")); | 282 expected_result_path.ReplaceExtension(FILE_PATH_LITERAL("txt")); |
282 return file_util::ReadFileToString(expected_result_path, | 283 return file_util::ReadFileToString(expected_result_path, |
283 expected_result_value); | 284 expected_result_value); |
284 } | 285 } |
OLD | NEW |