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

Unified Diff: components/metrics/metrics_log_unittest.cc

Issue 2428413005: Revise system profile prefs clearing (Closed)
Patch Set: Update LoadSavedEnvironmentFromPrefs's comment Created 4 years, 2 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 57a1209f1adfe809dee1b014bff7da3596ea43fb..9d4c2e5423f55c1d40540b6b08671462503260df 100644
--- a/components/metrics/metrics_log_unittest.cc
+++ b/components/metrics/metrics_log_unittest.cc
@@ -307,9 +307,9 @@ TEST_F(MetricsLogTest, LoadSavedEnvironmentFromPrefs) {
// Check some values in the system profile.
EXPECT_EQ(kInstallDateExpected, log.system_profile().install_date());
EXPECT_EQ(kEnabledDateExpected, log.system_profile().uma_enabled_date());
- // Ensure that the call cleared the prefs.
- EXPECT_TRUE(prefs_.GetString(kSystemProfilePref).empty());
- EXPECT_TRUE(prefs_.GetString(kSystemProfileHashPref).empty());
+ // Ensure that the call did not clear the prefs.
+ EXPECT_FALSE(prefs_.GetString(kSystemProfilePref).empty());
+ EXPECT_FALSE(prefs_.GetString(kSystemProfileHashPref).empty());
}
// Ensure that a non-matching hash results in the pref being invalid.
@@ -330,9 +330,9 @@ TEST_F(MetricsLogTest, LoadSavedEnvironmentFromPrefs) {
std::string app_version;
EXPECT_FALSE(log.LoadSavedEnvironmentFromPrefs(&app_version));
EXPECT_TRUE(app_version.empty());
- // Ensure that the prefs are cleared, even if the call failed.
- EXPECT_TRUE(prefs_.GetString(kSystemProfilePref).empty());
- EXPECT_TRUE(prefs_.GetString(kSystemProfileHashPref).empty());
+ // Ensure that the prefs are not cleared, even if the call failed.
+ EXPECT_FALSE(prefs_.GetString(kSystemProfilePref).empty());
+ EXPECT_FALSE(prefs_.GetString(kSystemProfileHashPref).empty());
}
}
« 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