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

Unified Diff: base/metrics/statistics_recorder_unittest.cc

Issue 1738063002: Refactor histogram_persistence to be a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed final review comments by Alexei Created 4 years, 9 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
Index: base/metrics/statistics_recorder_unittest.cc
diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc
index 17511a4d4ffa5ea7d57131b743300c08a8708308..073cbb1616458913b3c930cf7b5082b84025749a 100644
--- a/base/metrics/statistics_recorder_unittest.cc
+++ b/base/metrics/statistics_recorder_unittest.cc
@@ -10,7 +10,7 @@
#include "base/json/json_reader.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_macros.h"
-#include "base/metrics/histogram_persistence.h"
+#include "base/metrics/persistent_histogram_allocator.h"
#include "base/metrics/sparse_histogram.h"
#include "base/metrics/statistics_recorder.h"
#include "base/values.h"
@@ -23,7 +23,7 @@ class StatisticsRecorderTest : public testing::Test {
void SetUp() override {
// Get this first so it never gets created in persistent storage and will
// not appear in the StatisticsRecorder after it is re-initialized.
- GetCreateHistogramResultHistogram();
+ PersistentHistogramAllocator::GetCreateHistogramResultHistogram();
// Each test will have a clean state (no Histogram / BucketRanges
// registered).
InitializeStatisticsRecorder();
@@ -31,7 +31,7 @@ class StatisticsRecorderTest : public testing::Test {
void TearDown() override {
UninitializeStatisticsRecorder();
- delete ReleasePersistentHistogramMemoryAllocatorForTesting();
+ PersistentHistogramAllocator::ReleaseGlobalAllocatorForTesting();
}
void InitializeStatisticsRecorder() {
@@ -325,8 +325,8 @@ TEST_F(StatisticsRecorderTest, ToJSON) {
TEST_F(StatisticsRecorderTest, IterationTest) {
StatisticsRecorder::Histograms registered_histograms;
LOCAL_HISTOGRAM_COUNTS("TestHistogram.IterationTest1", 30);
- SetPersistentHistogramMemoryAllocator(
- new LocalPersistentMemoryAllocator(64 << 10, 0, std::string()));
+ PersistentHistogramAllocator::CreateGlobalAllocatorOnLocalMemory(
+ 64 << 10 /* 64 KiB */, 0, "");
LOCAL_HISTOGRAM_COUNTS("TestHistogram.IterationTest2", 30);
StatisticsRecorder::HistogramIterator i1 = StatisticsRecorder::begin(true);
« no previous file with comments | « base/metrics/persistent_histogram_allocator_unittest.cc ('k') | chrome/browser/chrome_browser_field_trials.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698