Index: chrome/browser/search/suggestions/blacklist_store_unittest.cc |
diff --git a/chrome/browser/search/suggestions/blacklist_store_unittest.cc b/chrome/browser/search/suggestions/blacklist_store_unittest.cc |
index b449ccf9a7c3588e2b27c14c50cdf8ef0a65aaab..599a1b0a6fbf002491d8505456811345fdef64c9 100644 |
--- a/chrome/browser/search/suggestions/blacklist_store_unittest.cc |
+++ b/chrome/browser/search/suggestions/blacklist_store_unittest.cc |
@@ -8,9 +8,7 @@ |
#include <string> |
#include "base/memory/scoped_ptr.h" |
-#include "base/metrics/histogram_samples.h" |
-#include "base/metrics/statistics_recorder.h" |
-#include "base/test/statistics_delta_reader.h" |
+#include "base/test/histogram_tester.h" |
#include "chrome/browser/search/suggestions/proto/suggestions.pb.h" |
#include "components/pref_registry/testing_pref_service_syncable.h" |
#include "content/public/test/test_browser_thread_bundle.h" |
@@ -123,18 +121,16 @@ TEST(BlacklistStoreTest, GetFirstUrlFromBlacklist) { |
} |
TEST(BlacklistStoreLogTest, LogsBlacklistSize) { |
+ base::HistogramTester histogram_tester; |
content::TestBrowserThreadBundle bundle; |
- base::StatisticsDeltaReader statistics_delta_reader; |
// Create a first store - blacklist is empty at this point. |
TestingPrefServiceSyncable prefs; |
BlacklistStore::RegisterProfilePrefs(prefs.registry()); |
scoped_ptr<BlacklistStore> blacklist_store(new BlacklistStore(&prefs)); |
- scoped_ptr<base::HistogramSamples> samples( |
- statistics_delta_reader.GetHistogramSamplesSinceCreation( |
- "Suggestions.LocalBlacklistSize")); |
- EXPECT_EQ(1, samples->TotalCount()); |
- EXPECT_EQ(1, samples->GetCount(0)); |
+ |
+ histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 1); |
+ histogram_tester.ExpectUniqueSample("Suggestions.LocalBlacklistSize", 0, 1); |
// Add some content to the blacklist. |
EXPECT_TRUE(blacklist_store->BlacklistUrl(GURL(kTestUrlA))); |
@@ -142,11 +138,10 @@ TEST(BlacklistStoreLogTest, LogsBlacklistSize) { |
// Create a new BlacklistStore and verify the counts. |
blacklist_store.reset(new BlacklistStore(&prefs)); |
- samples = statistics_delta_reader.GetHistogramSamplesSinceCreation( |
- "Suggestions.LocalBlacklistSize"); |
- EXPECT_EQ(2, samples->TotalCount()); |
- EXPECT_EQ(1, samples->GetCount(0)); |
- EXPECT_EQ(1, samples->GetCount(2)); |
+ |
+ histogram_tester.ExpectTotalCount("Suggestions.LocalBlacklistSize", 2); |
+ histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 0, 1); |
+ histogram_tester.ExpectBucketCount("Suggestions.LocalBlacklistSize", 2, 1); |
} |
} // namespace suggestions |