| Index: components/metrics/metrics_service_unittest.cc
|
| diff --git a/components/metrics/metrics_service_unittest.cc b/components/metrics/metrics_service_unittest.cc
|
| index fa8a18522c4b75a80c9e41ce076d866a9dbadf9f..f7ca1eeb6b44c67e212d757149c605bbd1624879 100644
|
| --- a/components/metrics/metrics_service_unittest.cc
|
| +++ b/components/metrics/metrics_service_unittest.cc
|
| @@ -20,9 +20,11 @@
|
| #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"
|
| +#include "components/metrics/stability_pref_names.h"
|
| #include "components/metrics/test_enabled_state_provider.h"
|
| #include "components/metrics/test_metrics_provider.h"
|
| #include "components/metrics/test_metrics_service_client.h"
|
| @@ -211,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.
|
| @@ -283,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);
|
|
|
|
|