Index: base/metrics/statistics_recorder_unittest.cc |
diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc |
index 6be7d5bb881a893791f45c83e8ff552ffa69d452..aede0b11fbfd56f8b074024250fc56638dc1a94b 100644 |
--- a/base/metrics/statistics_recorder_unittest.cc |
+++ b/base/metrics/statistics_recorder_unittest.cc |
@@ -36,12 +36,14 @@ class StatisticsRecorderTest : public testing::Test { |
} |
void InitializeStatisticsRecorder() { |
- statistics_recorder_ = new StatisticsRecorder(); |
+ DCHECK(!statistics_recorder_); |
+ StatisticsRecorder::UninitializeForTesting(); |
+ statistics_recorder_.reset(new StatisticsRecorder()); |
} |
void UninitializeStatisticsRecorder() { |
- delete statistics_recorder_; |
- statistics_recorder_ = NULL; |
+ statistics_recorder_.reset(); |
+ StatisticsRecorder::UninitializeForTesting(); |
} |
Histogram* CreateHistogram(const std::string& name, |
@@ -59,7 +61,7 @@ class StatisticsRecorderTest : public testing::Test { |
delete histogram; |
} |
- StatisticsRecorder* statistics_recorder_; |
+ std::unique_ptr<StatisticsRecorder> statistics_recorder_; |
}; |
TEST_F(StatisticsRecorderTest, NotInitialized) { |