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

Side by Side Diff: chrome/test/base/chrome_test_launcher.cc

Issue 2858103002: Have mash_browser_tests recreate BackgroundServiceManager per test (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | chrome/test/base/mash_browser_tests_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/test/base/chrome_test_launcher.h" 5 #include "chrome/test/base/chrome_test_launcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/app/chrome_main_delegate.h" 23 #include "chrome/app/chrome_main_delegate.h"
24 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
25 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/install_static/test/scoped_install_details.h" 26 #include "chrome/install_static/test/scoped_install_details.h"
27 #include "chrome/test/base/chrome_test_suite.h" 27 #include "chrome/test/base/chrome_test_suite.h"
28 #include "components/crash/content/app/crashpad.h" 28 #include "components/crash/content/app/crashpad.h"
29 #include "content/public/app/content_main.h" 29 #include "content/public/app/content_main.h"
30 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
31 #include "content/public/test/test_launcher.h" 31 #include "content/public/test/test_launcher.h"
32 #include "content/public/test/test_utils.h" 32 #include "content/public/test/test_utils.h"
33 #include "services/service_manager/runner/common/switches.h"
33 #include "ui/base/test/ui_controls.h" 34 #include "ui/base/test/ui_controls.h"
34 35
35 #if defined(OS_MACOSX) 36 #if defined(OS_MACOSX)
36 #include "chrome/browser/chrome_browser_application_mac.h" 37 #include "chrome/browser/chrome_browser_application_mac.h"
37 #endif // defined(OS_MACOSX) 38 #endif // defined(OS_MACOSX)
38 39
39 #if defined(USE_AURA) 40 #if defined(USE_AURA)
40 #include "ui/aura/test/ui_controls_factory_aura.h" 41 #include "ui/aura/test/ui_controls_factory_aura.h"
41 #include "ui/base/test/ui_controls_aura.h" 42 #include "ui/base/test/ui_controls_aura.h"
42 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 43 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
(...skipping 13 matching lines...) Expand all
56 #include <shellapi.h> 57 #include <shellapi.h>
57 #include "base/win/registry.h" 58 #include "base/win/registry.h"
58 #include "chrome/app/chrome_crash_reporter_client_win.h" 59 #include "chrome/app/chrome_crash_reporter_client_win.h"
59 #include "chrome/install_static/install_util.h" 60 #include "chrome/install_static/install_util.h"
60 #endif 61 #endif
61 62
62 ChromeTestSuiteRunner::ChromeTestSuiteRunner() {} 63 ChromeTestSuiteRunner::ChromeTestSuiteRunner() {}
63 ChromeTestSuiteRunner::~ChromeTestSuiteRunner() {} 64 ChromeTestSuiteRunner::~ChromeTestSuiteRunner() {}
64 65
65 int ChromeTestSuiteRunner::RunTestSuite(int argc, char** argv) { 66 int ChromeTestSuiteRunner::RunTestSuite(int argc, char** argv) {
67 #if defined(USE_AURA)
68 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
69 if (command_line->HasSwitch(service_manager::switches::kServicePipeToken))
70 content::GetContentMainParams()->env_mode = aura::Env::Mode::MUS;
71 #endif // defined(USE_AURA)
72
66 return ChromeTestSuite(argc, argv).Run(); 73 return ChromeTestSuite(argc, argv).Run();
67 } 74 }
68 75
69 ChromeTestLauncherDelegate::ChromeTestLauncherDelegate( 76 ChromeTestLauncherDelegate::ChromeTestLauncherDelegate(
70 ChromeTestSuiteRunner* runner) 77 ChromeTestSuiteRunner* runner)
71 : runner_(runner) {} 78 : runner_(runner) {}
72 ChromeTestLauncherDelegate::~ChromeTestLauncherDelegate() {} 79 ChromeTestLauncherDelegate::~ChromeTestLauncherDelegate() {}
73 80
74 int ChromeTestLauncherDelegate::RunTestSuite(int argc, char** argv) { 81 int ChromeTestLauncherDelegate::RunTestSuite(int argc, char** argv) {
75 return runner_->RunTestSuite(argc, argv); 82 return runner_->RunTestSuite(argc, argv);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WIN) 159 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WIN)
153 // We leak this pointer intentionally. The crash client needs to outlive 160 // We leak this pointer intentionally. The crash client needs to outlive
154 // all other code. 161 // all other code.
155 ChromeCrashReporterClient* crash_client = new ChromeCrashReporterClient(); 162 ChromeCrashReporterClient* crash_client = new ChromeCrashReporterClient();
156 ANNOTATE_LEAKING_OBJECT_PTR(crash_client); 163 ANNOTATE_LEAKING_OBJECT_PTR(crash_client);
157 crash_reporter::SetCrashReporterClient(crash_client); 164 crash_reporter::SetCrashReporterClient(crash_client);
158 #endif 165 #endif
159 166
160 return content::LaunchTests(delegate, default_jobs, argc, argv); 167 return content::LaunchTests(delegate, default_jobs, argc, argv);
161 } 168 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/base/mash_browser_tests_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698