crash-reporter: Ignore Chrome crashes, relying on Chrome breakpad
Change-Id: I08e44d2c8b6be839d18efd2fe6e8b612a61ae723 BUG=8841 TEST=bvts Review URL: http://codereview.chromium.org/4499006
This commit is contained in:
parent
a5118a97d5
commit
2105b49796
2 changed files with 33 additions and 10 deletions
|
|
@ -382,9 +382,21 @@ bool UserCollector::HandleCrash(int signal, int pid, const char *force_exec) {
|
|||
}
|
||||
|
||||
bool feedback = is_feedback_allowed_function_();
|
||||
const char *handling_string = "handling";
|
||||
if (!feedback) {
|
||||
handling_string = "ignoring - no consent";
|
||||
}
|
||||
|
||||
// Treat Chrome crashes as if the user opted-out. We stop counting Chrome
|
||||
// crashes towards user crashes, so user crashes really mean non-Chrome
|
||||
// user-space crashes.
|
||||
if (exec == "chrome") {
|
||||
feedback = false;
|
||||
handling_string = "ignoring - chrome crash";
|
||||
}
|
||||
|
||||
logger_->LogWarning("Received crash notification for %s[%d] sig %d (%s)",
|
||||
exec.c_str(), pid, signal,
|
||||
feedback ? "handling" : "ignoring - no consent");
|
||||
exec.c_str(), pid, signal, handling_string);
|
||||
|
||||
if (feedback) {
|
||||
count_crash_function_();
|
||||
|
|
|
|||
|
|
@ -89,19 +89,30 @@ TEST_F(UserCollectorTest, DisableNoFileAccess) {
|
|||
TEST_F(UserCollectorTest, HandleCrashWithoutMetrics) {
|
||||
s_metrics = false;
|
||||
collector_.HandleCrash(10, 20, "foobar");
|
||||
ASSERT_NE(logging_.log().find(
|
||||
"Received crash notification for foobar[20] sig 10"),
|
||||
std::string::npos);
|
||||
ASSERT_NE(std::string::npos,
|
||||
logging_.log().find(
|
||||
"Received crash notification for foobar[20] sig 10"));
|
||||
ASSERT_EQ(s_crashes, 0);
|
||||
}
|
||||
|
||||
TEST_F(UserCollectorTest, HandleCrashWithMetrics) {
|
||||
TEST_F(UserCollectorTest, HandleNonChromeCrashWithMetrics) {
|
||||
s_metrics = true;
|
||||
collector_.HandleCrash(2, 5, "chromeos-wm");
|
||||
ASSERT_NE(std::string::npos,
|
||||
logging_.log().find(
|
||||
"Received crash notification for chromeos-wm[5] sig 2"));
|
||||
ASSERT_EQ(s_crashes, 1);
|
||||
}
|
||||
|
||||
TEST_F(UserCollectorTest, HandleChromeCrashWithMetrics) {
|
||||
s_metrics = true;
|
||||
collector_.HandleCrash(2, 5, "chrome");
|
||||
ASSERT_NE(logging_.log().find(
|
||||
"Received crash notification for chrome[5] sig 2"),
|
||||
std::string::npos);
|
||||
ASSERT_EQ(s_crashes, 1);
|
||||
ASSERT_NE(std::string::npos,
|
||||
logging_.log().find(
|
||||
"Received crash notification for chrome[5] sig 2"));
|
||||
ASSERT_NE(std::string::npos,
|
||||
logging_.log().find("(ignoring - chrome crash)"));
|
||||
ASSERT_EQ(s_crashes, 0);
|
||||
}
|
||||
|
||||
TEST_F(UserCollectorTest, GetProcessPath) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue