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

Unified Diff: components/precache/core/precache_database_unittest.cc

Issue 2628513002: Add Precache.CacheStatus.Prefetch UMA. (Closed)
Patch Set: Created 3 years, 11 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 | « components/precache/core/precache_database.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/precache_database_unittest.cc
diff --git a/components/precache/core/precache_database_unittest.cc b/components/precache/core/precache_database_unittest.cc
index 5098786c7193461bcd97f20c63b5c43f72a495e4..98564d38b23b57862266fc0bc2b7617ce536fe64 100644
--- a/components/precache/core/precache_database_unittest.cc
+++ b/components/precache/core/precache_database_unittest.cc
@@ -260,6 +260,7 @@ TEST_F(PrecacheDatabaseTest, PrecacheOverNetwork) {
ExpectNewSample("Precache.DownloadedPrecacheMotivated", kSize);
ExpectNewSample("Precache.Latency.Prefetch", kLatency.InMilliseconds());
+ ExpectNewSample("Precache.CacheStatus.Prefetch", kFromNetwork);
ExpectNewSample("Precache.Freshness.Prefetch", kFreshnessBucket10K);
ExpectNoOtherSamples();
}
@@ -273,6 +274,8 @@ TEST_F(PrecacheDatabaseTest, PrecacheFromCacheWithURLTableEntry) {
EXPECT_EQ(BuildURLTableMap(kURL, kFetchTime), GetActualURLTableMap());
ExpectNewSample("Precache.Latency.Prefetch", 0);
+ ExpectNewSample("Precache.CacheStatus.Prefetch",
+ net::HttpResponseInfo::ENTRY_USED);
ExpectNewSample("Precache.Freshness.Prefetch", kFreshnessBucket10K);
ExpectNoOtherSamples();
}
@@ -283,6 +286,8 @@ TEST_F(PrecacheDatabaseTest, PrecacheFromCacheWithoutURLTableEntry) {
EXPECT_TRUE(GetActualURLTableMap().empty());
ExpectNewSample("Precache.Latency.Prefetch", 0);
+ ExpectNewSample("Precache.CacheStatus.Prefetch",
+ net::HttpResponseInfo::ENTRY_USED);
ExpectNewSample("Precache.Freshness.Prefetch", kFreshnessBucket10K);
ExpectNoOtherSamples();
}
« no previous file with comments | « components/precache/core/precache_database.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698