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 <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); | 338 new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); |
339 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); | 339 new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); |
340 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); | 340 new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); |
341 | 341 |
342 char* browser_wrapper = getenv("BROWSER_WRAPPER"); | 342 char* browser_wrapper = getenv("BROWSER_WRAPPER"); |
343 | 343 |
344 test_launcher->LaunchChildGTestProcess( | 344 test_launcher->LaunchChildGTestProcess( |
345 new_cmd_line, | 345 new_cmd_line, |
346 browser_wrapper ? browser_wrapper : std::string(), | 346 browser_wrapper ? browser_wrapper : std::string(), |
347 TestTimeouts::action_max_timeout(), | 347 TestTimeouts::action_max_timeout(), |
| 348 true, |
348 base::Bind(&WrapperTestLauncherDelegate::GTestCallback, | 349 base::Bind(&WrapperTestLauncherDelegate::GTestCallback, |
349 base::Unretained(this), | 350 base::Unretained(this), |
350 test_launcher, | 351 test_launcher, |
351 test_name)); | 352 test_name)); |
352 } | 353 } |
353 | 354 |
354 void WrapperTestLauncherDelegate::RunDependentTest( | 355 void WrapperTestLauncherDelegate::RunDependentTest( |
355 base::TestLauncher* test_launcher, | 356 base::TestLauncher* test_launcher, |
356 const std::string test_name, | 357 const std::string test_name, |
357 const base::TestResult& pre_test_result) { | 358 const base::TestResult& pre_test_result) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 "--single-process (to do the above, and also run Chrome in single-" | 487 "--single-process (to do the above, and also run Chrome in single-" |
487 "process mode).\n"); | 488 "process mode).\n"); |
488 | 489 |
489 base::MessageLoopForIO message_loop; | 490 base::MessageLoopForIO message_loop; |
490 | 491 |
491 // Allow the |launcher_delegate| to modify |default_jobs|. | 492 // Allow the |launcher_delegate| to modify |default_jobs|. |
492 launcher_delegate->AdjustDefaultParallelJobs(&default_jobs); | 493 launcher_delegate->AdjustDefaultParallelJobs(&default_jobs); |
493 | 494 |
494 WrapperTestLauncherDelegate delegate(launcher_delegate); | 495 WrapperTestLauncherDelegate delegate(launcher_delegate); |
495 base::TestLauncher launcher(&delegate, default_jobs); | 496 base::TestLauncher launcher(&delegate, default_jobs); |
496 bool success = launcher.Run(argc, argv); | 497 return (launcher.Run() ? 0 : 1); |
497 return (success ? 0 : 1); | |
498 } | 498 } |
499 | 499 |
500 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 500 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
501 return g_launcher_delegate; | 501 return g_launcher_delegate; |
502 } | 502 } |
503 | 503 |
504 ContentMainParams* GetContentMainParams() { | 504 ContentMainParams* GetContentMainParams() { |
505 return g_params; | 505 return g_params; |
506 } | 506 } |
507 | 507 |
508 } // namespace content | 508 } // namespace content |
OLD | NEW |