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

Unified Diff: base/metrics/sparse_histogram_unittest.cc

Issue 484603006: Add LOCAL_ prefix to non-UMA histogram macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 years, 4 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 | « base/metrics/sparse_histogram.h ('k') | base/metrics/statistics_recorder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sparse_histogram_unittest.cc
diff --git a/base/metrics/sparse_histogram_unittest.cc b/base/metrics/sparse_histogram_unittest.cc
index 825381d8535dca6e045e47cf8fd592f72eb55500..6a0efa4e12b616cc28229076edc5011b4662c75d 100644
--- a/base/metrics/sparse_histogram_unittest.cc
+++ b/base/metrics/sparse_histogram_unittest.cc
@@ -64,9 +64,9 @@ TEST_F(SparseHistogramTest, BasicTest) {
}
TEST_F(SparseHistogramTest, MacroBasicTest) {
- HISTOGRAM_SPARSE_SLOWLY("Sparse", 100);
- HISTOGRAM_SPARSE_SLOWLY("Sparse", 200);
- HISTOGRAM_SPARSE_SLOWLY("Sparse", 100);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 100);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 200);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Sparse", 100);
StatisticsRecorder::Histograms histograms;
StatisticsRecorder::GetHistograms(&histograms);
@@ -76,7 +76,8 @@ TEST_F(SparseHistogramTest, MacroBasicTest) {
EXPECT_EQ(SPARSE_HISTOGRAM, sparse_histogram->GetHistogramType());
EXPECT_EQ("Sparse", sparse_histogram->histogram_name());
- EXPECT_EQ(HistogramBase::kNoFlags, sparse_histogram->flags());
+ EXPECT_EQ(HistogramBase::kUmaTargetedHistogramFlag,
+ sparse_histogram->flags());
scoped_ptr<HistogramSamples> samples = sparse_histogram->SnapshotSamples();
EXPECT_EQ(3, samples->TotalCount());
@@ -84,20 +85,6 @@ TEST_F(SparseHistogramTest, MacroBasicTest) {
EXPECT_EQ(1, samples->GetCount(200));
}
-TEST_F(SparseHistogramTest, MacroUmaTest) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Uma", 100);
-
- StatisticsRecorder::Histograms histograms;
- StatisticsRecorder::GetHistograms(&histograms);
-
- ASSERT_EQ(1U, histograms.size());
- HistogramBase* sparse_histogram = histograms[0];
-
- EXPECT_EQ("Uma", sparse_histogram->histogram_name());
- EXPECT_EQ(HistogramBase::kUmaTargetedHistogramFlag,
- sparse_histogram->flags());
-}
-
TEST_F(SparseHistogramTest, MacroInLoopTest) {
// Unlike the macros in histogram.h, SparseHistogram macros can have a
// variable as histogram name.
« no previous file with comments | « base/metrics/sparse_histogram.h ('k') | base/metrics/statistics_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698