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

Unified Diff: chrome/test/base/uma_histogram_helper.cc

Issue 263683002: Set file tokens for NaCl main nexe if available to enable validation caching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: concat filepath literal Created 6 years, 7 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: chrome/test/base/uma_histogram_helper.cc
diff --git a/chrome/test/base/uma_histogram_helper.cc b/chrome/test/base/uma_histogram_helper.cc
index e65bf0582667717e5f04f32d39d5d885f740c983..9b5122974bb6cc4ede50a82bc235d7b83f0a3c45 100644
--- a/chrome/test/base/uma_histogram_helper.cc
+++ b/chrome/test/base/uma_histogram_helper.cc
@@ -44,6 +44,21 @@ void UMAHistogramHelper::ExpectUniqueSample(
}
}
+void UMAHistogramHelper::ExpectBucketCount(
+ const std::string& name,
+ base::HistogramBase::Sample sample,
+ base::HistogramBase::Count expected_count) {
+ base::HistogramBase* histogram =
+ base::StatisticsRecorder::FindHistogram(name);
+ EXPECT_NE(static_cast<base::HistogramBase*>(NULL), histogram)
+ << "Histogram \"" << name << "\" does not exist.";
+
+ if (histogram) {
+ scoped_ptr<base::HistogramSamples> samples(histogram->SnapshotSamples());
+ CheckBucketCount(name, sample, expected_count, *samples);
+ }
+}
+
void UMAHistogramHelper::ExpectTotalCount(
const std::string& name,
base::HistogramBase::Count count) {

Powered by Google App Engine
This is Rietveld 408576698