Commit 243fc0d9 authored by Wez's avatar Wez Committed by Commit Bot

[Fuchsia] Support --enable-logging=stderr and use in browser tests.

- Support --enable-logging and allow it to be used to enable logging
  to stderr.
- Add --enable-logging=stderr to the command-line in WebEngine
  browser-tests.

Bug: 968387
Change-Id: Ie29db5b086beac7867c0b01746006814a9759517
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1732673
Auto-Submit: Wez <wez@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683847}
parent 6617cd64
...@@ -57,9 +57,10 @@ class WebEngineTestLauncherDelegate : public content::TestLauncherDelegate { ...@@ -57,9 +57,10 @@ class WebEngineTestLauncherDelegate : public content::TestLauncherDelegate {
int main(int argc, char** argv) { int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv); base::CommandLine::Init(argc, argv);
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( auto* command_line = base::CommandLine::ForCurrentProcess();
switches::kOzonePlatform, "headless"); command_line->AppendSwitchASCII(switches::kOzonePlatform, "headless");
base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableGpu); command_line->AppendSwitchASCII(switches::kEnableLogging, "stderr");
command_line->AppendSwitch(switches::kDisableGpu);
size_t parallel_jobs = base::NumParallelJobs(); size_t parallel_jobs = base::NumParallelJobs();
if (parallel_jobs > 1U) { if (parallel_jobs > 1U) {
......
...@@ -24,7 +24,11 @@ WebEngineMainDelegate* g_current_web_engine_main_delegate = nullptr; ...@@ -24,7 +24,11 @@ WebEngineMainDelegate* g_current_web_engine_main_delegate = nullptr;
void InitLoggingFromCommandLine(const base::CommandLine& command_line) { void InitLoggingFromCommandLine(const base::CommandLine& command_line) {
logging::LoggingSettings settings; logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; if (command_line.GetSwitchValueASCII(switches::kEnableLogging) == "stderr") {
settings.logging_dest = logging::LOG_TO_STDERR;
} else {
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
}
if (command_line.HasSwitch(switches::kLogFile)) { if (command_line.HasSwitch(switches::kLogFile)) {
settings.logging_dest |= logging::LOG_TO_FILE; settings.logging_dest |= logging::LOG_TO_FILE;
settings.log_file = settings.log_file =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment