Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Unified Diff: user_collector_test.cc

Issue 4499006: crash-reporter: Ignore Chrome crashes, relying on Chrome breakpad (Closed) Base URL: http://git.chromium.org/git/crash-reporter.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« user_collector.cc ('K') | « user_collector.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: user_collector_test.cc
diff --git a/user_collector_test.cc b/user_collector_test.cc
index db707f5accce5ce6d86f65c24c038e5e97b87687..25fbc846255c11f0277a80de04931c8a80f97982 100644
--- a/user_collector_test.cc
+++ b/user_collector_test.cc
@@ -154,24 +154,35 @@ TEST_F(UserCollectorTest, ForkExecAndPipe) {
logging_.log().find("Process did not exit normally"));
}
-TEST_F(UserCollectorTest, HandleCrashWithoutMetrics) {
+TEST_F(UserCollectorTest, HandleNonChromeCrashWithoutMetrics) {
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, "chrome");
- ASSERT_NE(logging_.log().find(
- "Received crash notification for chrome[5] sig 2"),
- std::string::npos);
+ 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(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) {
FilePath path = collector_.GetProcessPath(100);
ASSERT_EQ("/proc/100", path.value());
« user_collector.cc ('K') | « user_collector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698