mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Pass --always_allow_feedback during integration tests
During ChromeOS integration tests, pass --always_allow_feedback to crash_reporter. Most integration tests do not set metrics consent but still want crash dumps. Needs https://chromium-review.googlesource.com/c/chromium/src/+/1981139 as well BUG=chromium:1037656 TEST=tast -verbose run --extrauseflags chrome_internal my_crbook ui.ChromeCrashNotLoggedInDirect Change-Id: Ibc7af4b31da789c52aec6e668a4b192d4e20fdfc Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1981037 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Commit-Queue: Ian Barkley-Yeung <iby@chromium.org>
This commit is contained in:
parent
c2978022d1
commit
558b7ea43f
@ -168,6 +168,10 @@ void Usage(const base::FilePath& me) {
|
||||
" --minidump-dir-for-tests=TEST_MINIDUMP_DIR\n"
|
||||
" causes /sbin/crash_reporter to leave dumps in\n"
|
||||
" this directory instead of the normal location\n"
|
||||
" --always-allow-feedback\n"
|
||||
" pass the --always_allow_feedback flag to\n"
|
||||
" crash_reporter, thus skipping metrics consent\n"
|
||||
" checks\n"
|
||||
#endif // OS_CHROMEOS
|
||||
" --help display this help and exit\n"
|
||||
" --version output version information and exit\n",
|
||||
@ -201,8 +205,9 @@ struct Options {
|
||||
bool rate_limit;
|
||||
bool upload_gzip;
|
||||
#if defined(OS_CHROMEOS)
|
||||
bool use_cros_crash_reporter;
|
||||
bool use_cros_crash_reporter = false;
|
||||
base::FilePath minidump_dir_for_tests;
|
||||
bool always_allow_feedback = false;
|
||||
#endif // OS_CHROMEOS
|
||||
};
|
||||
|
||||
@ -561,6 +566,7 @@ int HandlerMain(int argc,
|
||||
#if defined(OS_CHROMEOS)
|
||||
kOptionUseCrosCrashReporter,
|
||||
kOptionMinidumpDirForTests,
|
||||
kOptionAlwaysAllowFeedback,
|
||||
#endif // OS_CHROMEOS
|
||||
|
||||
// Standard options.
|
||||
@ -636,6 +642,10 @@ int HandlerMain(int argc,
|
||||
required_argument,
|
||||
nullptr,
|
||||
kOptionMinidumpDirForTests},
|
||||
{"always-allow-feedback",
|
||||
no_argument,
|
||||
nullptr,
|
||||
kOptionAlwaysAllowFeedback},
|
||||
#endif // OS_CHROMEOS
|
||||
{"help", no_argument, nullptr, kOptionHelp},
|
||||
{"version", no_argument, nullptr, kOptionVersion},
|
||||
@ -788,6 +798,10 @@ int HandlerMain(int argc,
|
||||
ToolSupport::CommandLineArgumentToFilePathStringType(optarg));
|
||||
break;
|
||||
}
|
||||
case kOptionAlwaysAllowFeedback: {
|
||||
options.always_allow_feedback = true;
|
||||
break;
|
||||
}
|
||||
#endif // OS_CHROMEOS
|
||||
case kOptionHelp: {
|
||||
Usage(me);
|
||||
@ -931,6 +945,10 @@ int HandlerMain(int argc,
|
||||
cros_handler->SetDumpDir(options.minidump_dir_for_tests);
|
||||
}
|
||||
|
||||
if (options.always_allow_feedback) {
|
||||
cros_handler->SetAlwaysAllowFeedback();
|
||||
}
|
||||
|
||||
exception_handler = std::move(cros_handler);
|
||||
} else {
|
||||
exception_handler = std::make_unique<CrashReportExceptionHandler>(
|
||||
|
@ -133,7 +133,8 @@ CrosCrashReportExceptionHandler::CrosCrashReportExceptionHandler(
|
||||
const UserStreamDataSources* user_stream_data_sources)
|
||||
: database_(database),
|
||||
process_annotations_(process_annotations),
|
||||
user_stream_data_sources_(user_stream_data_sources) {}
|
||||
user_stream_data_sources_(user_stream_data_sources),
|
||||
always_allow_feedback_(false) {}
|
||||
|
||||
CrosCrashReportExceptionHandler::~CrosCrashReportExceptionHandler() = default;
|
||||
|
||||
@ -258,6 +259,9 @@ bool CrosCrashReportExceptionHandler::HandleExceptionWithConnection(
|
||||
if (!dump_dir_.empty()) {
|
||||
argv.push_back("--chrome_dump_dir=" + dump_dir_.value());
|
||||
}
|
||||
if (always_allow_feedback_) {
|
||||
argv.push_back("--always_allow_feedback");
|
||||
}
|
||||
|
||||
if (!DoubleForkAndExec(argv,
|
||||
nullptr /* envp */,
|
||||
|
@ -77,6 +77,7 @@ class CrosCrashReportExceptionHandler
|
||||
UUID* local_report_id = nullptr) override;
|
||||
|
||||
void SetDumpDir(const base::FilePath& dump_dir) { dump_dir_ = dump_dir; }
|
||||
void SetAlwaysAllowFeedback() { always_allow_feedback_ = true; }
|
||||
private:
|
||||
bool HandleExceptionWithConnection(
|
||||
PtraceConnection* connection,
|
||||
@ -90,6 +91,7 @@ class CrosCrashReportExceptionHandler
|
||||
const std::map<std::string, std::string>* process_annotations_; // weak
|
||||
const UserStreamDataSources* user_stream_data_sources_; // weak
|
||||
base::FilePath dump_dir_;
|
||||
bool always_allow_feedback_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CrosCrashReportExceptionHandler);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user