Commit 46b33153 authored by Tricia Crichton's avatar Tricia Crichton Committed by Commit Bot

[ChromeDriver] Enable collection of minidumps

Enable the collection of minidumps on Windows and Mac instead of only on
linux.

Bug: 1045241
Change-Id: Ib81420783c02b27d1edef2e575bb1b2369da5846
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2055003Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tricia Crichton <triciac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741130}
parent cf5b133b
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "base/time/time.h" #include "base/time/time.h"
...@@ -100,9 +101,7 @@ const char* const kAndroidSwitches[] = { ...@@ -100,9 +101,7 @@ const char* const kAndroidSwitches[] = {
"disable-fre", "enable-remote-debugging", "disable-fre", "enable-remote-debugging",
}; };
#if defined(OS_LINUX)
const char kEnableCrashReport[] = "enable-crash-reporter-for-testing"; const char kEnableCrashReport[] = "enable-crash-reporter-for-testing";
#endif
const base::FilePath::CharType kDevToolsActivePort[] = const base::FilePath::CharType kDevToolsActivePort[] =
FILE_PATH_LITERAL("DevToolsActivePort"); FILE_PATH_LITERAL("DevToolsActivePort");
...@@ -426,22 +425,31 @@ Status LaunchDesktopChrome(network::mojom::URLLoaderFactory* factory, ...@@ -426,22 +425,31 @@ Status LaunchDesktopChrome(network::mojom::URLLoaderFactory* factory,
base::LaunchOptions options; base::LaunchOptions options;
#if defined(OS_LINUX) #if defined(OS_WIN) || defined(OS_POSIX) || defined(OS_FUCHSIA)
// If minidump path is set in the capability, enable minidump for crashes. // If minidump path is set in the capability, enable minidump for crashes.
if (!capabilities.minidump_path.empty()) { if (!capabilities.minidump_path.empty()) {
VLOG(0) << "Minidump generation specified. Will save dumps to: " VLOG(0) << "Minidump generation specified. Will save dumps to: "
<< capabilities.minidump_path; << capabilities.minidump_path;
#if defined(OS_WIN)
// EnvironmentMap uses wide string
options.environment[L"CHROME_HEADLESS"] = 1;
options.environment[L"BREAKPAD_DUMP_LOCATION"] =
base::SysUTF8ToWide(capabilities.minidump_path);
#else
options.environment["CHROME_HEADLESS"] = 1; options.environment["CHROME_HEADLESS"] = 1;
options.environment["BREAKPAD_DUMP_LOCATION"] = capabilities.minidump_path; options.environment["BREAKPAD_DUMP_LOCATION"] = capabilities.minidump_path;
#endif
if (!command.HasSwitch(kEnableCrashReport)) if (!command.HasSwitch(kEnableCrashReport))
command.AppendSwitch(kEnableCrashReport); command.AppendSwitch(kEnableCrashReport);
} }
#if defined(OS_LINUX)
// We need to allow new privileges so that chrome's setuid sandbox can run. // We need to allow new privileges so that chrome's setuid sandbox can run.
options.allow_new_privs = true; options.allow_new_privs = true;
#endif #endif
#endif // OS_WIN || OS_POSIX || OS_FUCHSIA
#if !defined(OS_WIN) #if !defined(OS_WIN)
if (!capabilities.log_path.empty()) if (!capabilities.log_path.empty())
......
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