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 "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 | 252 |
253 for (size_t i = 0; i < test_names.size(); i++) { | 253 for (size_t i = 0; i < test_names.size(); i++) { |
254 std::string full_name(test_names[i]); | 254 std::string full_name(test_names[i]); |
255 | 255 |
256 // Make sure no PRE_ tests were requested explicitly. | 256 // Make sure no PRE_ tests were requested explicitly. |
257 DCHECK_EQ(full_name, RemoveAnyPrePrefixes(full_name)); | 257 DCHECK_EQ(full_name, RemoveAnyPrePrefixes(full_name)); |
258 | 258 |
259 if (!base::ContainsKey(user_data_dir_map_, full_name)) { | 259 if (!base::ContainsKey(user_data_dir_map_, full_name)) { |
260 base::FilePath temp_dir; | 260 base::FilePath temp_dir; |
261 CHECK(base::CreateTemporaryDirInDir(temp_dir_.path(), | 261 CHECK(base::CreateTemporaryDirInDir(temp_dir_.GetPath(), |
262 FILE_PATH_LITERAL("d"), &temp_dir)); | 262 FILE_PATH_LITERAL("d"), &temp_dir)); |
263 user_data_dir_map_[full_name] = temp_dir; | 263 user_data_dir_map_[full_name] = temp_dir; |
264 } | 264 } |
265 | 265 |
266 // If the test has any dependencies, get to the root and start with that. | 266 // If the test has any dependencies, get to the root and start with that. |
267 while (base::ContainsKey(reverse_dependent_test_map_, full_name)) | 267 while (base::ContainsKey(reverse_dependent_test_map_, full_name)) |
268 full_name = GetPreTestName(full_name); | 268 full_name = GetPreTestName(full_name); |
269 | 269 |
270 std::vector<std::string> test_list; | 270 std::vector<std::string> test_list; |
271 test_list.push_back(full_name); | 271 test_list.push_back(full_name); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 for (std::set<std::string>::const_iterator i = test_names_set.begin(); | 309 for (std::set<std::string>::const_iterator i = test_names_set.begin(); |
310 i != test_names_set.end(); | 310 i != test_names_set.end(); |
311 ++i) { | 311 ++i) { |
312 std::string full_name(*i); | 312 std::string full_name(*i); |
313 | 313 |
314 // Make sure PRE_ tests and tests that depend on them share the same | 314 // Make sure PRE_ tests and tests that depend on them share the same |
315 // data directory - based it on the test name without prefixes. | 315 // data directory - based it on the test name without prefixes. |
316 std::string test_name_no_pre(RemoveAnyPrePrefixes(full_name)); | 316 std::string test_name_no_pre(RemoveAnyPrePrefixes(full_name)); |
317 if (!base::ContainsKey(user_data_dir_map_, test_name_no_pre)) { | 317 if (!base::ContainsKey(user_data_dir_map_, test_name_no_pre)) { |
318 base::FilePath temp_dir; | 318 base::FilePath temp_dir; |
319 CHECK(base::CreateTemporaryDirInDir(temp_dir_.path(), | 319 CHECK(base::CreateTemporaryDirInDir(temp_dir_.GetPath(), |
320 FILE_PATH_LITERAL("d"), &temp_dir)); | 320 FILE_PATH_LITERAL("d"), &temp_dir)); |
321 user_data_dir_map_[test_name_no_pre] = temp_dir; | 321 user_data_dir_map_[test_name_no_pre] = temp_dir; |
322 } | 322 } |
323 | 323 |
324 size_t dot_pos = full_name.find('.'); | 324 size_t dot_pos = full_name.find('.'); |
325 CHECK_NE(dot_pos, std::string::npos); | 325 CHECK_NE(dot_pos, std::string::npos); |
326 std::string test_case_name = full_name.substr(0, dot_pos); | 326 std::string test_case_name = full_name.substr(0, dot_pos); |
327 std::string test_name = full_name.substr(dot_pos + 1); | 327 std::string test_name = full_name.substr(dot_pos + 1); |
328 std::string pre_test_name( | 328 std::string pre_test_name( |
329 test_case_name + "." + kPreTestPrefix + test_name); | 329 test_case_name + "." + kPreTestPrefix + test_name); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 550 |
551 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 551 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
552 return g_launcher_delegate; | 552 return g_launcher_delegate; |
553 } | 553 } |
554 | 554 |
555 ContentMainParams* GetContentMainParams() { | 555 ContentMainParams* GetContentMainParams() { |
556 return g_params; | 556 return g_params; |
557 } | 557 } |
558 | 558 |
559 } // namespace content | 559 } // namespace content |
OLD | NEW |