| 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/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 ThreadTaskRunnerHandle::Get()->PostTask( | 965 ThreadTaskRunnerHandle::Get()->PostTask( |
| 966 FROM_HERE, Bind(&TestLauncher::RunTestIteration, Unretained(this))); | 966 FROM_HERE, Bind(&TestLauncher::RunTestIteration, Unretained(this))); |
| 967 } | 967 } |
| 968 } | 968 } |
| 969 | 969 |
| 970 void TestLauncher::RunTestIteration() { | 970 void TestLauncher::RunTestIteration() { |
| 971 const bool stop_on_failure = | 971 const bool stop_on_failure = |
| 972 CommandLine::ForCurrentProcess()->HasSwitch(kGTestBreakOnFailure); | 972 CommandLine::ForCurrentProcess()->HasSwitch(kGTestBreakOnFailure); |
| 973 if (cycles_ == 0 || | 973 if (cycles_ == 0 || |
| 974 (stop_on_failure && test_success_count_ != test_finished_count_)) { | 974 (stop_on_failure && test_success_count_ != test_finished_count_)) { |
| 975 MessageLoop::current()->Quit(); | 975 MessageLoop::current()->QuitWhenIdle(); |
| 976 return; | 976 return; |
| 977 } | 977 } |
| 978 | 978 |
| 979 // Special value "-1" means "repeat indefinitely". | 979 // Special value "-1" means "repeat indefinitely". |
| 980 cycles_ = (cycles_ == -1) ? cycles_ : cycles_ - 1; | 980 cycles_ = (cycles_ == -1) ? cycles_ : cycles_ - 1; |
| 981 | 981 |
| 982 test_started_count_ = 0; | 982 test_started_count_ = 0; |
| 983 test_finished_count_ = 0; | 983 test_finished_count_ = 0; |
| 984 test_success_count_ = 0; | 984 test_success_count_ = 0; |
| 985 test_broken_count_ = 0; | 985 test_broken_count_ = 0; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 std::string snippet(full_output.substr(run_pos)); | 1089 std::string snippet(full_output.substr(run_pos)); |
| 1090 if (end_pos != std::string::npos) | 1090 if (end_pos != std::string::npos) |
| 1091 snippet = full_output.substr(run_pos, end_pos - run_pos); | 1091 snippet = full_output.substr(run_pos, end_pos - run_pos); |
| 1092 | 1092 |
| 1093 return snippet; | 1093 return snippet; |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 } // namespace base | 1096 } // namespace base |
| OLD | NEW |