Index: base/test/launcher/test_launcher.cc |
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc |
index 9150e636c3c0b7c8984b1e146ea25ccfb0cdd0cd..78ff176265fa1bb83762ce8c9d33c1263381cf5e 100644 |
--- a/base/test/launcher/test_launcher.cc |
+++ b/base/test/launcher/test_launcher.cc |
@@ -629,10 +629,9 @@ bool TestLauncher::Init() { |
return false; |
} |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kTestLauncherRetryLimit)) { |
+ if (command_line->HasSwitch(switches::kTestLauncherRetryLimit)) { |
int retry_limit = -1; |
- if (!StringToInt(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ if (!StringToInt(command_line->GetSwitchValueASCII( |
switches::kTestLauncherRetryLimit), &retry_limit) || |
retry_limit < 0) { |
LOG(ERROR) << "Invalid value for " << switches::kTestLauncherRetryLimit; |
@@ -640,15 +639,15 @@ bool TestLauncher::Init() { |
} |
retry_limit_ = retry_limit; |
- } else if (!CommandLine::ForCurrentProcess()->HasSwitch(kGTestFilterFlag)) { |
- // Retry failures 3 times by default if we are running all of the tests. |
+ } else if (!command_line->HasSwitch(kGTestFilterFlag) || BotModeEnabled()) { |
+ // Retry failures 3 times by default if we are running all of the tests or |
+ // in bot mode. |
retry_limit_ = 3; |
} |
- if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kTestLauncherJobs)) { |
+ if (command_line->HasSwitch(switches::kTestLauncherJobs)) { |
int jobs = -1; |
- if (!StringToInt(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ if (!StringToInt(command_line->GetSwitchValueASCII( |
switches::kTestLauncherJobs), &jobs) || |
jobs < 0) { |
LOG(ERROR) << "Invalid value for " << switches::kTestLauncherJobs; |
@@ -656,9 +655,9 @@ bool TestLauncher::Init() { |
} |
parallel_jobs_ = jobs; |
- } else if (CommandLine::ForCurrentProcess()->HasSwitch(kGTestFilterFlag)) { |
+ } else if (command_line->HasSwitch(kGTestFilterFlag) && !BotModeEnabled()) { |
// Do not run jobs in parallel by default if we are running a subset of |
- // the tests. |
+ // the tests and if bot mode is off. |
parallel_jobs_ = 1; |
} |