Commit 58664d67 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Redirect WebEngine logs in integration tests to stderr.

Now integration tests will launch WebEngine with --enable-logging=stderr
and dup it's own stderr to WebEngine.

Bug: 1009099
Change-Id: I9b0e15f22fc7a758ccdc5e78a3548a34bca6651d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956225
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722653}
parent adc47226
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <lib/fdio/directory.h> #include <lib/fdio/directory.h>
#include <lib/fidl/cpp/binding.h> #include <lib/fidl/cpp/binding.h>
#include <lib/sys/cpp/component_context.h> #include <lib/sys/cpp/component_context.h>
#include <zircon/processargs.h>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/fuchsia/default_context.h" #include "base/fuchsia/default_context.h"
...@@ -53,6 +54,15 @@ class WebEngineIntegrationTest : public testing::Test { ...@@ -53,6 +54,15 @@ class WebEngineIntegrationTest : public testing::Test {
launch_info.url = "fuchsia-pkg://fuchsia.com/chromium#meta/chromium.cmx"; launch_info.url = "fuchsia-pkg://fuchsia.com/chromium#meta/chromium.cmx";
launch_info.arguments = command_line.argv(); launch_info.arguments = command_line.argv();
// Clone stderr from the current process to WebEngine and ask it to
// redirects all logs to stderr.
launch_info.err = fuchsia::sys::FileDescriptor::New();
launch_info.err->type0 = PA_FD;
zx_status_t status = fdio_fd_clone(
STDERR_FILENO, launch_info.err->handle0.reset_and_get_address());
ZX_CHECK(status == ZX_OK, status);
launch_info.arguments->push_back("--enable-logging=stderr");
fidl::InterfaceHandle<fuchsia::io::Directory> web_engine_services_dir; fidl::InterfaceHandle<fuchsia::io::Directory> web_engine_services_dir;
launch_info.directory_request = launch_info.directory_request =
web_engine_services_dir.NewRequest().TakeChannel(); web_engine_services_dir.NewRequest().TakeChannel();
......
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