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

Unified Diff: chrome/test/base/mash_browser_tests_main.cc

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: Disable broken tests 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/mash_browser_tests_main.cc
diff --git a/chrome/test/base/mash_browser_tests_main.cc b/chrome/test/base/mash_browser_tests_main.cc
index 7ff38d4fd633e3d6b355ee7db7ec34899f622635..13f5c6a3ab6dbe09d61cd5f4705ea5fc3463054d 100644
--- a/chrome/test/base/mash_browser_tests_main.cc
+++ b/chrome/test/base/mash_browser_tests_main.cc
@@ -115,6 +115,14 @@ class MashTestLauncherDelegate : public ChromeTestLauncherDelegate {
base::Unretained(this)));
}
+ bool AdjustChildProcessCommandLine(
+ base::CommandLine* command_line,
+ const base::FilePath& temp_data_dir) override {
+ bool result = ChromeTestLauncherDelegate::AdjustChildProcessCommandLine(
sky 2017/05/12 17:16:47 It doesn't seem that this override is necessary. C
jonross 2017/05/12 18:08:02 Whoops, missed this when I was removing my debuggi
jonross 2017/05/16 21:54:45 Done.
+ command_line, temp_data_dir);
+ return result;
+ }
+
void OnTestProcessLaunched() {
// Start default apps after chrome, as they may try to connect to chrome on
// startup. Attempt to connect once per test in case a previous test crashed
@@ -153,9 +161,11 @@ class MashTestLauncherDelegate : public ChromeTestLauncherDelegate {
std::unique_ptr<content::ServiceManagerConnection>
CreateServiceManagerConnection(MashTestLauncherDelegate* delegate) {
+ delegate->GetMojoTestConnectorForSingleProcess()->Init();
std::unique_ptr<content::ServiceManagerConnection> connection(
content::ServiceManagerConnection::Create(
- delegate->GetMojoTestConnectorForSingleProcess()->Init(),
+ delegate->GetMojoTestConnectorForSingleProcess()
+ ->InitBackgroundServiceManager(),
base::ThreadTaskRunnerHandle::Get()));
connection->Start();
connection->GetConnector()->StartService(mash::session::mojom::kServiceName);

Powered by Google App Engine
This is Rietveld 408576698