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()); |