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

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

Issue 2342403002: Use base::Thread instead of single-threaded SequencedWorkerPool in TestLauncher. (Closed)
Patch Set: cleaner DCHECKs Created 4 years, 3 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 38980cfd60ac3355f2aff06acacb8e8abc9bd0f8..3f6bbaa5f9a41fbad221693e6d5cf7207567c349 100644
--- a/base/test/launcher/test_launcher.h
+++ b/base/test/launcher/test_launcher.h
@@ -32,6 +32,7 @@ class CommandLine;
struct LaunchOptions;
class SequencedWorkerPoolOwner;
class TestLauncher;
+class Thread;
// Constants for GTest command-line flags.
extern const char kGTestFilterFlag[];
@@ -165,6 +166,10 @@ class TestLauncher {
// Called by the delay timer when no output was made for a while.
void OnOutputTimeout();
+ // Returns the TaskRunner to be used to launch child test processes. This
+ // TaskRunner will have TaskShutdownBehavior::BLOCK_SHUTDOWN semantics.
+ scoped_refptr<TaskRunner> GetTaskRunner();
+
// Make sure we don't accidentally call the wrong methods e.g. on the worker
// pool thread. With lots of callbacks used this is non-trivial.
// Should be the first member so that it's destroyed last: when destroying
@@ -227,8 +232,10 @@ class TestLauncher {
// Number of jobs to run in parallel.
size_t parallel_jobs_;
- // Worker pool used to launch processes in parallel.
+ // Worker pool used to launch processes in parallel (|worker_thread_| is used
+ // instead if |parallel_jobs == 1|).
std::unique_ptr<SequencedWorkerPoolOwner> worker_pool_owner_;
+ std::unique_ptr<Thread> worker_thread_;
DISALLOW_COPY_AND_ASSIGN(TestLauncher);
};
« 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