| Index: chrome/browser/extensions/api/metrics_private/metrics_apitest.cc
|
| diff --git a/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc b/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc
|
| index f910a35279edd9860388eae837e309b56e313b30..8f7ec4b4bb715348af69e3d4068e61f423ea496f 100644
|
| --- a/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc
|
| +++ b/chrome/browser/extensions/api/metrics_private/metrics_apitest.cc
|
| @@ -38,6 +38,8 @@ struct RecordedHistogram {
|
| {"test.h.1", base::HISTOGRAM, 1, 100, 50, 1}, // custom
|
| {"test.h.2", base::LINEAR_HISTOGRAM, 1, 200, 50, 1}, // custom
|
| {"test.h.3", base::LINEAR_HISTOGRAM, 1, 101, 102, 2}, // percentage
|
| + {"test.sparse.1", base::SPARSE_HISTOGRAM, 0, 0, 0, 1},
|
| + {"test.sparse.2", base::SPARSE_HISTOGRAM, 0, 0, 0, 2},
|
| {"test.time", base::HISTOGRAM, 1, 10000, 50, 1},
|
| {"test.medium.time", base::HISTOGRAM, 1, 180000, 50, 1},
|
| {"test.long.time", base::HISTOGRAM, 1, 3600000, 50, 1},
|
| @@ -116,8 +118,13 @@ void ValidateHistograms(const RecordedHistogram* recorded,
|
|
|
| if (r.name == histogram->histogram_name()) {
|
| EXPECT_EQ(r.type, histogram->GetHistogramType());
|
| - EXPECT_TRUE(
|
| - histogram->HasConstructionArguments(r.min, r.max, r.buckets));
|
| + if (r.type == base::SPARSE_HISTOGRAM) {
|
| + EXPECT_FALSE(
|
| + histogram->HasConstructionArguments(r.min, r.max, r.buckets));
|
| + } else {
|
| + EXPECT_TRUE(
|
| + histogram->HasConstructionArguments(r.min, r.max, r.buckets));
|
| + }
|
| scoped_ptr<base::HistogramSamples> snapshot =
|
| histogram->SnapshotSamples();
|
| base::HistogramBase::Count sample_count = snapshot->TotalCount();
|
|
|