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

Side by Side Diff: content/public/test/test_launcher.h

Issue 2893703002: Cleanup PreferenceMACs on browser_tests startup (Closed)
Patch Set: re-enable PrefHashBrowserTests disabled for this issue Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_
6 #define CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Called prior to running each test. The delegate may alter the CommandLine 51 // Called prior to running each test. The delegate may alter the CommandLine
52 // and options used to launch the subprocess. Additionally the client may 52 // and options used to launch the subprocess. Additionally the client may
53 // return a TestState that is destroyed once the test completes as well as 53 // return a TestState that is destroyed once the test completes as well as
54 // once the test process is launched. 54 // once the test process is launched.
55 // 55 //
56 // NOTE: this is not called if --single_process is supplied. 56 // NOTE: this is not called if --single_process is supplied.
57 virtual std::unique_ptr<TestState> PreRunTest( 57 virtual std::unique_ptr<TestState> PreRunTest(
58 base::CommandLine* command_line, 58 base::CommandLine* command_line,
59 base::TestLauncher::LaunchOptions* test_launch_options); 59 base::TestLauncher::LaunchOptions* test_launch_options);
60 60
61 // Allows a TestLauncherDelegate to cleanup any global state (e.g. registry)
62 // before sharding the tests into multiple processes who may access that
63 // state.
64 virtual void PreShardingCleanup() {}
jam 2017/05/17 19:06:16 nit: just call it PreSharding and don't mention im
gab 2017/05/17 20:01:05 Done.
65
61 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used 66 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used
62 // when --test-launcher-jobs isn't specified on the command-line. 67 // when --test-launcher-jobs isn't specified on the command-line.
63 virtual void AdjustDefaultParallelJobs(int* default_jobs) {} 68 virtual void AdjustDefaultParallelJobs(int* default_jobs) {}
64 69
65 // Called prior to returning from LaunchTests(). Gives the delegate a chance 70 // Called prior to returning from LaunchTests(). Gives the delegate a chance
66 // to do cleanup before state created by TestLauncher has been destroyed (such 71 // to do cleanup before state created by TestLauncher has been destroyed (such
67 // as the AtExitManager). 72 // as the AtExitManager).
68 virtual void OnDoneRunningTests(); 73 virtual void OnDoneRunningTests();
69 74
70 protected: 75 protected:
71 virtual ~TestLauncherDelegate(); 76 virtual ~TestLauncherDelegate();
72 }; 77 };
73 78
74 // Launches tests using |launcher_delegate|. |default_jobs| is number 79 // Launches tests using |launcher_delegate|. |default_jobs| is number
75 // of test jobs to be run in parallel, unless overridden from the command line. 80 // of test jobs to be run in parallel, unless overridden from the command line.
76 // Returns exit code. 81 // Returns exit code.
77 int LaunchTests(TestLauncherDelegate* launcher_delegate, 82 int LaunchTests(TestLauncherDelegate* launcher_delegate,
78 int default_jobs, 83 int default_jobs,
79 int argc, 84 int argc,
80 char** argv) WARN_UNUSED_RESULT; 85 char** argv) WARN_UNUSED_RESULT;
81 86
82 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); 87 TestLauncherDelegate* GetCurrentTestLauncherDelegate();
83 ContentMainParams* GetContentMainParams(); 88 ContentMainParams* GetContentMainParams();
84 89
85 } // namespace content 90 } // namespace content
86 91
87 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ 92 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698