| 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 "base/test/launcher/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 fflush(stdout); | 88 fflush(stdout); |
| 89 } | 89 } |
| 90 | 90 |
| 91 class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate { | 91 class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate { |
| 92 public: | 92 public: |
| 93 DefaultUnitTestPlatformDelegate() { | 93 DefaultUnitTestPlatformDelegate() { |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 // UnitTestPlatformDelegate: | 97 // UnitTestPlatformDelegate: |
| 98 bool GetTests(std::vector<SplitTestName>* output) override { | 98 bool GetTests(std::vector<TestIdentifier>* output) override { |
| 99 *output = GetCompiledInTests(); | 99 *output = GetCompiledInTests(); |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool CreateTemporaryFile(base::FilePath* path) override { | 103 bool CreateTemporaryFile(base::FilePath* path) override { |
| 104 if (!CreateNewTempDirectory(FilePath::StringType(), path)) | 104 if (!CreateNewTempDirectory(FilePath::StringType(), path)) |
| 105 return false; | 105 return false; |
| 106 *path = path->AppendASCII("test_results.xml"); | 106 *path = path->AppendASCII("test_results.xml"); |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 bool use_job_objects) | 530 bool use_job_objects) |
| 531 : platform_delegate_(platform_delegate), | 531 : platform_delegate_(platform_delegate), |
| 532 batch_limit_(batch_limit), | 532 batch_limit_(batch_limit), |
| 533 use_job_objects_(use_job_objects) { | 533 use_job_objects_(use_job_objects) { |
| 534 } | 534 } |
| 535 | 535 |
| 536 UnitTestLauncherDelegate::~UnitTestLauncherDelegate() { | 536 UnitTestLauncherDelegate::~UnitTestLauncherDelegate() { |
| 537 DCHECK(thread_checker_.CalledOnValidThread()); | 537 DCHECK(thread_checker_.CalledOnValidThread()); |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool UnitTestLauncherDelegate::GetTests(std::vector<SplitTestName>* output) { | 540 bool UnitTestLauncherDelegate::GetTests(std::vector<TestIdentifier>* output) { |
| 541 DCHECK(thread_checker_.CalledOnValidThread()); | 541 DCHECK(thread_checker_.CalledOnValidThread()); |
| 542 return platform_delegate_->GetTests(output); | 542 return platform_delegate_->GetTests(output); |
| 543 } | 543 } |
| 544 | 544 |
| 545 bool UnitTestLauncherDelegate::ShouldRunTest(const std::string& test_case_name, | 545 bool UnitTestLauncherDelegate::ShouldRunTest(const std::string& test_case_name, |
| 546 const std::string& test_name) { | 546 const std::string& test_name) { |
| 547 DCHECK(thread_checker_.CalledOnValidThread()); | 547 DCHECK(thread_checker_.CalledOnValidThread()); |
| 548 | 548 |
| 549 // There is no additional logic to disable specific tests. | 549 // There is no additional logic to disable specific tests. |
| 550 return true; | 550 return true; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 577 TestLauncher* test_launcher, | 577 TestLauncher* test_launcher, |
| 578 const std::vector<std::string>& test_names) { | 578 const std::vector<std::string>& test_names) { |
| 579 ThreadTaskRunnerHandle::Get()->PostTask( | 579 ThreadTaskRunnerHandle::Get()->PostTask( |
| 580 FROM_HERE, | 580 FROM_HERE, |
| 581 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, | 581 Bind(&RunUnitTestsSerially, test_launcher, platform_delegate_, test_names, |
| 582 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); | 582 use_job_objects_ ? TestLauncher::USE_JOB_OBJECTS : 0)); |
| 583 return test_names.size(); | 583 return test_names.size(); |
| 584 } | 584 } |
| 585 | 585 |
| 586 } // namespace base | 586 } // namespace base |
| OLD | NEW |