| OLD | NEW |
| 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 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/app/chrome_main_delegate.h" | 22 #include "chrome/app/chrome_main_delegate.h" |
| 23 #include "chrome/common/chrome_constants.h" | 23 #include "chrome/common/chrome_constants.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/install_static/test/scoped_install_details.h" | 25 #include "chrome/install_static/test/scoped_install_details.h" |
| 26 #include "chrome/test/base/chrome_test_suite.h" | 26 #include "chrome/test/base/chrome_test_suite.h" |
| 27 #include "components/crash/content/app/crashpad.h" | 27 #include "components/crash/content/app/crashpad.h" |
| 28 #include "content/public/app/content_main.h" | 28 #include "content/public/app/content_main.h" |
| 29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 30 #include "content/public/test/test_launcher.h" | 30 #include "content/public/test/test_launcher.h" |
| 31 #include "content/public/test/test_utils.h" | 31 #include "content/public/test/test_utils.h" |
| 32 #include "services/service_manager/runner/common/switches.h" |
| 32 #include "ui/base/test/ui_controls.h" | 33 #include "ui/base/test/ui_controls.h" |
| 33 | 34 |
| 34 #if defined(OS_MACOSX) | 35 #if defined(OS_MACOSX) |
| 35 #include "chrome/browser/chrome_browser_application_mac.h" | 36 #include "chrome/browser/chrome_browser_application_mac.h" |
| 36 #endif // defined(OS_MACOSX) | 37 #endif // defined(OS_MACOSX) |
| 37 | 38 |
| 38 #if defined(USE_AURA) | 39 #if defined(USE_AURA) |
| 39 #include "ui/aura/test/ui_controls_factory_aura.h" | 40 #include "ui/aura/test/ui_controls_factory_aura.h" |
| 40 #include "ui/base/test/ui_controls_aura.h" | 41 #include "ui/base/test/ui_controls_aura.h" |
| 41 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 42 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 #endif | 53 #endif |
| 53 | 54 |
| 54 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 55 #include "chrome/app/chrome_crash_reporter_client_win.h" | 56 #include "chrome/app/chrome_crash_reporter_client_win.h" |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 ChromeTestSuiteRunner::ChromeTestSuiteRunner() {} | 59 ChromeTestSuiteRunner::ChromeTestSuiteRunner() {} |
| 59 ChromeTestSuiteRunner::~ChromeTestSuiteRunner() {} | 60 ChromeTestSuiteRunner::~ChromeTestSuiteRunner() {} |
| 60 | 61 |
| 61 int ChromeTestSuiteRunner::RunTestSuite(int argc, char** argv) { | 62 int ChromeTestSuiteRunner::RunTestSuite(int argc, char** argv) { |
| 63 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 64 if (command_line->HasSwitch(service_manager::switches::kServicePipeToken)) |
| 65 content::GetContentMainParams()->env_mode = aura::Env::Mode::MUS; |
| 66 |
| 62 return ChromeTestSuite(argc, argv).Run(); | 67 return ChromeTestSuite(argc, argv).Run(); |
| 63 } | 68 } |
| 64 | 69 |
| 65 ChromeTestLauncherDelegate::ChromeTestLauncherDelegate( | 70 ChromeTestLauncherDelegate::ChromeTestLauncherDelegate( |
| 66 ChromeTestSuiteRunner* runner) | 71 ChromeTestSuiteRunner* runner) |
| 67 : runner_(runner) {} | 72 : runner_(runner) {} |
| 68 ChromeTestLauncherDelegate::~ChromeTestLauncherDelegate() {} | 73 ChromeTestLauncherDelegate::~ChromeTestLauncherDelegate() {} |
| 69 | 74 |
| 70 int ChromeTestLauncherDelegate::RunTestSuite(int argc, char** argv) { | 75 int ChromeTestLauncherDelegate::RunTestSuite(int argc, char** argv) { |
| 71 return runner_->RunTestSuite(argc, argv); | 76 return runner_->RunTestSuite(argc, argv); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WIN) | 117 #if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_WIN) |
| 113 // We leak this pointer intentionally. The crash client needs to outlive | 118 // We leak this pointer intentionally. The crash client needs to outlive |
| 114 // all other code. | 119 // all other code. |
| 115 ChromeCrashReporterClient* crash_client = new ChromeCrashReporterClient(); | 120 ChromeCrashReporterClient* crash_client = new ChromeCrashReporterClient(); |
| 116 ANNOTATE_LEAKING_OBJECT_PTR(crash_client); | 121 ANNOTATE_LEAKING_OBJECT_PTR(crash_client); |
| 117 crash_reporter::SetCrashReporterClient(crash_client); | 122 crash_reporter::SetCrashReporterClient(crash_client); |
| 118 #endif | 123 #endif |
| 119 | 124 |
| 120 return content::LaunchTests(delegate, default_jobs, argc, argv); | 125 return content::LaunchTests(delegate, default_jobs, argc, argv); |
| 121 } | 126 } |
| OLD | NEW |