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

Unified Diff: components/metrics/metrics_log_unittest.cc

Issue 2294323002: Avoid some pref writes in MetricsLog. Ensure some stability metrics are cleared. (Closed)
Patch Set: Fix unittests Created 4 years, 4 months 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
« no previous file with comments | « components/metrics/metrics_log.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_log_unittest.cc
diff --git a/components/metrics/metrics_log_unittest.cc b/components/metrics/metrics_log_unittest.cc
index fe03ff8607ce9ff8f8b1149a6b66a50bc56cbaef..807328cb1da4bfab270afc0395d816878ce7b71d 100644
--- a/components/metrics/metrics_log_unittest.cc
+++ b/components/metrics/metrics_log_unittest.cc
@@ -388,12 +388,12 @@ TEST_F(MetricsLogTest, InitialLogStabilityMetrics) {
// Required metrics:
EXPECT_TRUE(stability.has_launch_count());
EXPECT_TRUE(stability.has_crash_count());
- // Initial log metrics:
- EXPECT_TRUE(stability.has_incomplete_shutdown_count());
- EXPECT_TRUE(stability.has_breakpad_registration_success_count());
- EXPECT_TRUE(stability.has_breakpad_registration_failure_count());
- EXPECT_TRUE(stability.has_debugger_present_count());
- EXPECT_TRUE(stability.has_debugger_not_present_count());
+ // Initial log metrics: only expected if non-zero.
+ EXPECT_FALSE(stability.has_incomplete_shutdown_count());
+ EXPECT_FALSE(stability.has_breakpad_registration_success_count());
+ EXPECT_FALSE(stability.has_breakpad_registration_failure_count());
+ EXPECT_FALSE(stability.has_debugger_present_count());
+ EXPECT_FALSE(stability.has_debugger_not_present_count());
// The test provider should have been called upon to provide initial
// stability and regular stability metrics.
@@ -418,7 +418,7 @@ TEST_F(MetricsLogTest, OngoingLogStabilityMetrics) {
// Required metrics:
EXPECT_TRUE(stability.has_launch_count());
EXPECT_TRUE(stability.has_crash_count());
- // Initial log metrics:
+ // Initial log metrics: only expected if non-zero.
EXPECT_FALSE(stability.has_incomplete_shutdown_count());
EXPECT_FALSE(stability.has_breakpad_registration_success_count());
EXPECT_FALSE(stability.has_breakpad_registration_failure_count());
« no previous file with comments | « components/metrics/metrics_log.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698