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

Unified Diff: chrome/test/test_launcher_utils.cc

Issue 7104059: Revert 88111 - GTTF: Move --test-terminate-timeout logic to base/test/test_timeouts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/test_timeouts.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/test_launcher_utils.cc
===================================================================
--- chrome/test/test_launcher_utils.cc (revision 88351)
+++ chrome/test/test_launcher_utils.cc (working copy)
@@ -15,6 +15,10 @@
namespace {
+// TODO(phajdan.jr): remove this flag and fix its users.
+// We should use base/test/test_timeouts and not custom flags.
+static const char kTestTerminateTimeoutFlag[] = "test-terminate-timeout";
+
// A multiplier for slow tests. We generally avoid multiplying
// test timeouts by any constants. Here it is used as last resort
// to implement the SLOW_ test prefix.
@@ -90,6 +94,18 @@
int GetTestTerminationTimeout(const std::string& test_name,
int default_timeout_ms) {
int timeout_ms = default_timeout_ms;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(kTestTerminateTimeoutFlag)) {
+ std::string timeout_str =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ kTestTerminateTimeoutFlag);
+ int timeout;
+ if (base::StringToInt(timeout_str, &timeout)) {
+ timeout_ms = std::max(timeout_ms, timeout);
+ } else {
+ LOG(ERROR) << "Invalid timeout (" << kTestTerminateTimeoutFlag << "): "
+ << timeout_str;
+ }
+ }
// Make it possible for selected tests to request a longer timeout.
// Generally tests should really avoid doing too much, and splitting
« no previous file with comments | « base/test/test_timeouts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698