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

Unified Diff: base/test/launcher/test_launcher.h

Issue 441333002: Disallow breakaway from job for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 4 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 | « no previous file | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.h
diff --git a/base/test/launcher/test_launcher.h b/base/test/launcher/test_launcher.h
index d50bf2fb3b52b0bd203457ad0d5616469e3ff0db..1837aad1b725ab3c15aa976b7fa4ce213c7a358b 100644
--- a/base/test/launcher/test_launcher.h
+++ b/base/test/launcher/test_launcher.h
@@ -69,6 +69,18 @@ class TestLauncherDelegate {
// Launches tests using a TestLauncherDelegate.
class TestLauncher {
public:
+ // Flags controlling behavior of LaunchChildGTestProcess.
+ enum LaunchChildGTestProcessFlags {
+ // Allows usage of job objects on Windows. Helps properly clean up child
+ // processes.
+ USE_JOB_OBJECTS = (1 << 0),
+
+ // Allows breakaway from job on Windows. May result in some child processes
+ // not being properly terminated after launcher dies if these processes
+ // fail to cooperate.
+ ALLOW_BREAKAWAY_FROM_JOB = (1 << 1),
+ };
+
// Constructor. |parallel_jobs| is the limit of simultaneous parallel test
// jobs.
TestLauncher(TestLauncherDelegate* launcher_delegate, size_t parallel_jobs);
@@ -87,13 +99,12 @@ class TestLauncher {
// Launches a child process (assumed to be gtest-based binary) using
// |command_line|. If |wrapper| is not empty, it is prepended to the final
// command line. If the child process is still running after |timeout|, it
- // is terminated. |use_job_objects| determines whether job objects are used
- // on Windows (if unsure pass true). After the child process finishes
- // |callback| is called on the same thread this method was called.
+ // is terminated. After the child process finishes |callback| is called
+ // on the same thread this method was called.
void LaunchChildGTestProcess(const CommandLine& command_line,
const std::string& wrapper,
base::TimeDelta timeout,
- bool use_job_objects,
+ int flags,
const LaunchChildGTestProcessCallback& callback);
// Called when a test has finished running.
« no previous file with comments | « no previous file | base/test/launcher/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698