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

Unified Diff: content/public/test/test_launcher.h

Issue 1806353003: Adds option to run browser tests in mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 9 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
Index: content/public/test/test_launcher.h
diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h
index 3f399b007bf64f9e17252957a0472a79721c8b6f..117c65866ba967afb9489b7d9a96eeb07be93a04 100644
--- a/content/public/test/test_launcher.h
+++ b/content/public/test/test_launcher.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/test/launcher/test_launcher.h"
namespace base {
class CommandLine;
@@ -28,6 +29,17 @@ extern const char kSingleProcessTestsFlag[];
// Flag that causes only the kEmptyTestName test to be run.
extern const char kWarmupFlag[];
+// See details in PreRunTest().
+class TestState {
+ public:
+ virtual ~TestState() {}
+
+ // Called once test process has launched (and is still running).
+ // NOTE: this is called on a background thread.
+ virtual void ChildProcessLaunched(base::ProcessHandle handle,
+ base::ProcessId pid) = 0;
+};
+
class TestLauncherDelegate {
public:
virtual int RunTestSuite(int argc, char** argv) = 0;
@@ -38,6 +50,16 @@ class TestLauncherDelegate {
virtual void PostRunMessageLoop() {}
virtual ContentMainDelegate* CreateContentMainDelegate() = 0;
+ // Called prior to running each test. The delegate may alter the CommandLine
+ // and options used to launch the subprocess. Additionally the client may
+ // return a TestState that is destroyed once the test completes as well as
+ // once the test process is launched.
+ //
+ // NOTE: this is not called if --single_process is supplied.
+ virtual scoped_ptr<TestState> PreRunTest(
+ base::CommandLine* command_line,
+ base::TestLauncher::LaunchOptions* test_launch_options);
+
// Allows a TestLauncherDelegate to adjust the number of |default_jobs| used
// when --test-launcher-jobs isn't specified on the command-line.
virtual void AdjustDefaultParallelJobs(int* default_jobs) {}

Powered by Google App Engine
This is Rietveld 408576698