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

Unified Diff: components/metrics/metrics_service_unittest.cc

Issue 2687393004: Gather stability prefs into managing objects. (Closed)
Patch Set: Incorporate Feedback Created 3 years, 10 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_service.cc ('k') | components/metrics/stability_metrics_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service_unittest.cc
diff --git a/components/metrics/metrics_service_unittest.cc b/components/metrics/metrics_service_unittest.cc
index f4a264cafe10ebc3bcda4940279ee6b5da9065cd..2d5e32fdbb8c3dbe9ef44e15d8291ab2d326a3c5 100644
--- a/components/metrics/metrics_service_unittest.cc
+++ b/components/metrics/metrics_service_unittest.cc
@@ -20,6 +20,7 @@
#include "base/threading/platform_thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/metrics/client_info.h"
+#include "components/metrics/environment_recorder.h"
#include "components/metrics/metrics_log.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_state_manager.h"
@@ -212,10 +213,9 @@ TEST_F(MetricsServiceTest, InitialStabilityLogAtProviderRequest) {
// Record stability build time and version from previous session, so that
// stability metrics (including exited cleanly flag) won't be cleared.
- GetLocalState()->SetInt64(prefs::kStabilityStatsBuildTime,
- MetricsLog::GetBuildTime());
- GetLocalState()->SetString(prefs::kStabilityStatsVersion,
- client.GetVersionString());
+ EnvironmentRecorder(GetLocalState())
+ .SetBuildtimeAndVersion(MetricsLog::GetBuildTime(),
+ client.GetVersionString());
// Set the clean exit flag, as that will otherwise cause a stabilty
// log to be produced, irrespective provider requests.
@@ -284,10 +284,9 @@ TEST_F(MetricsServiceTest, InitialStabilityLogAfterCrash) {
// Record stability build time and version from previous session, so that
// stability metrics (including exited cleanly flag) won't be cleared.
- GetLocalState()->SetInt64(prefs::kStabilityStatsBuildTime,
- MetricsLog::GetBuildTime());
- GetLocalState()->SetString(prefs::kStabilityStatsVersion,
- client.GetVersionString());
+ EnvironmentRecorder(GetLocalState())
+ .SetBuildtimeAndVersion(MetricsLog::GetBuildTime(),
+ client.GetVersionString());
GetLocalState()->SetBoolean(prefs::kStabilityExitedCleanly, false);
« no previous file with comments | « components/metrics/metrics_service.cc ('k') | components/metrics/stability_metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698