Clean up TestLauncherDelegate.

BUG=236893
R=sky@chromium.org

Review URL: https://codereview.chromium.org/133653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244566 0039d316-1c4b-4281-b951-d872f2087c98
parent 4980ccde
......@@ -770,14 +770,11 @@ void TestLauncher::RunTests() {
continue;
}
std::string filtering_test_name =
launcher_delegate_->GetTestNameForFiltering(test_case, test_info);
// Skip the test that doesn't match the filter (if given).
if (!positive_test_filter_.empty()) {
bool found = false;
for (size_t k = 0; k < positive_test_filter_.size(); ++k) {
if (MatchPattern(filtering_test_name, positive_test_filter_[k])) {
if (MatchPattern(test_name, positive_test_filter_[k])) {
found = true;
break;
}
......@@ -788,7 +785,7 @@ void TestLauncher::RunTests() {
}
bool excluded = false;
for (size_t k = 0; k < negative_test_filter_.size(); ++k) {
if (MatchPattern(filtering_test_name, negative_test_filter_[k])) {
if (MatchPattern(test_name, negative_test_filter_[k])) {
excluded = true;
break;
}
......@@ -835,7 +832,6 @@ void TestLauncher::RunTestIteration() {
retry_count_ = 0;
tests_to_retry_.clear();
results_tracker_.OnTestIterationStarting();
launcher_delegate_->OnTestIterationStarting();
MessageLoop::current()->PostTask(
FROM_HERE, Bind(&TestLauncher::RunTests, Unretained(this)));
......
......@@ -41,18 +41,6 @@ extern const char kGTestOutputFlag[];
// which tests and how are run.
class TestLauncherDelegate {
public:
// Called at the start of each test iteration.
virtual void OnTestIterationStarting() = 0;
// Called to get a test name for filtering purposes. Usually it's
// test case's name and test's name joined by a dot (e.g.
// "TestCaseName.TestName").
// TODO(phajdan.jr): Remove after transitioning away from run_test_cases.py,
// http://crbug.com/236893 .
virtual std::string GetTestNameForFiltering(
const testing::TestCase* test_case,
const testing::TestInfo* test_info) = 0;
// Called before a test is considered for running. If it returns false,
// the test is not run. If it returns true, the test will be run provided
// it is part of the current shard.
......
......@@ -117,18 +117,6 @@ class UnitTestLauncherDelegate : public TestLauncherDelegate {
FilePath output_file;
};
virtual void OnTestIterationStarting() OVERRIDE {
// Nothing to do.
}
virtual std::string GetTestNameForFiltering(
const testing::TestCase* test_case,
const testing::TestInfo* test_info) OVERRIDE {
DCHECK(thread_checker_.CalledOnValidThread());
return std::string(test_case->name()) + "." + test_info->name();
}
virtual bool ShouldRunTest(const testing::TestCase* test_case,
const testing::TestInfo* test_info) OVERRIDE {
DCHECK(thread_checker_.CalledOnValidThread());
......
......@@ -118,10 +118,6 @@ class WrapperTestLauncherDelegate : public base::TestLauncherDelegate {
}
// base::TestLauncherDelegate:
virtual void OnTestIterationStarting() OVERRIDE;
virtual std::string GetTestNameForFiltering(
const testing::TestCase* test_case,
const testing::TestInfo* test_info) OVERRIDE;
virtual bool ShouldRunTest(const testing::TestCase* test_case,
const testing::TestInfo* test_info) OVERRIDE;
virtual size_t RunTests(base::TestLauncher* test_launcher,
......@@ -174,18 +170,6 @@ class WrapperTestLauncherDelegate : public base::TestLauncherDelegate {
DISALLOW_COPY_AND_ASSIGN(WrapperTestLauncherDelegate);
};
void WrapperTestLauncherDelegate::OnTestIterationStarting() {
dependent_test_map_.clear();
user_data_dir_map_.clear();
}
std::string WrapperTestLauncherDelegate::GetTestNameForFiltering(
const testing::TestCase* test_case,
const testing::TestInfo* test_info) {
return RemoveAnyPrePrefixes(
std::string(test_case->name()) + "." + test_info->name());
}
bool WrapperTestLauncherDelegate::ShouldRunTest(
const testing::TestCase* test_case,
const testing::TestInfo* test_info) {
......@@ -217,6 +201,10 @@ std::string GetPreTestName(const std::string& full_name) {
size_t WrapperTestLauncherDelegate::RunTests(
base::TestLauncher* test_launcher,
const std::vector<std::string>& test_names) {
dependent_test_map_.clear();
reverse_dependent_test_map_.clear();
user_data_dir_map_.clear();
// Number of additional tests to run because of dependencies.
size_t additional_tests_to_run_count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment