Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: base/test/launcher/unit_test_launcher.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/test/launcher/unit_test_launcher.h" 5 #include "base/test/launcher/unit_test_launcher.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 // due to a crash. 432 // due to a crash.
433 DCHECK(tests_to_relaunch.empty()); 433 DCHECK(tests_to_relaunch.empty());
434 434
435 // There is only one test, we should have called back with its result. 435 // There is only one test, we should have called back with its result.
436 DCHECK(called_any_callbacks); 436 DCHECK(called_any_callbacks);
437 437
438 // The temporary file's directory is also temporary. 438 // The temporary file's directory is also temporary.
439 DeleteFile(callback_state.output_file.DirName(), true); 439 DeleteFile(callback_state.output_file.DirName(), true);
440 440
441 ThreadTaskRunnerHandle::Get()->PostTask( 441 ThreadTaskRunnerHandle::Get()->PostTask(
442 FROM_HERE, Bind(&RunUnitTestsSerially, callback_state.test_launcher, 442 FROM_HERE, BindOnce(&RunUnitTestsSerially, callback_state.test_launcher,
443 callback_state.platform_delegate, test_names, 443 callback_state.platform_delegate, test_names,
444 callback_state.launch_flags)); 444 callback_state.launch_flags));
445 } 445 }
446 446
447 } // namespace 447 } // namespace
448 448
449 int LaunchUnitTests(int argc, 449 int LaunchUnitTests(int argc,
450 char** argv, 450 char** argv,
451 const RunTestSuiteCallback& run_test_suite) { 451 const RunTestSuiteCallback& run_test_suite) {
452 CommandLine::Init(argc, argv); 452 CommandLine::Init(argc, argv);
453 return LaunchUnitTestsInternal( 453 return LaunchUnitTestsInternal(
454 run_test_suite, 454 run_test_suite,
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 RunUnitTestsBatch(test_launcher, platform_delegate_, batch, launch_flags); 629 RunUnitTestsBatch(test_launcher, platform_delegate_, batch, launch_flags);
630 630
631 return test_names.size(); 631 return test_names.size();
632 } 632 }
633 633
634 size_t UnitTestLauncherDelegate::RetryTests( 634 size_t UnitTestLauncherDelegate::RetryTests(
635 TestLauncher* test_launcher, 635 TestLauncher* test_launcher,
636 const std::vector<std::string>& test_names) { 636 const std::vector<std::string>& test_names) {
637 ThreadTaskRunnerHandle::Get()->PostTask( 637 ThreadTaskRunnerHandle::Get()->PostTask(
638 FROM_HERE, 638 FROM_HERE,
639 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, 639 BindOnce(&RunUnitTestsSerially, test_launcher, platform_delegate_,
640 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); 640 test_names,
641 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0));
641 return test_names.size(); 642 return test_names.size();
642 } 643 }
643 644
644 } // namespace base 645 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/test_launcher.cc ('k') | base/test/scoped_mock_time_message_loop_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698