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

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

Issue 2364873004: Add Precache.CacheStatus.NonPrefetch.FromPrecache. (Closed)
Patch Set: Add const. Created 4 years, 2 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') | components/precache/core/precache_url_table.h » ('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 aa9fa26ed3b45cb4147677c2c15162cc82a844cb..8d00c79f6f6c0c36bc49e985454d235f5c118dd3 100644
--- a/components/precache/core/precache_database_unittest.cc
+++ b/components/precache/core/precache_database_unittest.cc
@@ -101,6 +101,8 @@ class PrecacheDatabaseTest : public testing::Test {
ASSERT_TRUE(precache_database_->Init(db_path));
}
+ void TearDown() override { precache_url_table()->DeleteAll(); }
+
std::map<GURL, base::Time> GetActualURLTableMap() {
// Flush any buffered writes so that the URL table will be up to date.
precache_database_->Flush();
@@ -335,6 +337,8 @@ TEST_F(PrecacheDatabaseTest, FetchOverNetworkWithURLTableEntry) {
ExpectNewSample("Precache.Latency.NonPrefetch.NonTopHosts",
kLatency.InMilliseconds());
ExpectNewSample("Precache.CacheStatus.NonPrefetch", kFromNetwork);
+ ExpectNewSample("Precache.CacheStatus.NonPrefetch.FromPrecache",
+ kFromNetwork);
ExpectNoOtherSamples();
}
@@ -349,6 +353,8 @@ TEST_F(PrecacheDatabaseTest, FetchFromCacheWithURLTableEntry_NonCellular) {
ExpectNewSample("Precache.Latency.NonPrefetch.NonTopHosts", 0);
ExpectNewSample("Precache.CacheStatus.NonPrefetch",
HttpResponseInfo::CacheEntryStatus::ENTRY_USED);
+ ExpectNewSample("Precache.CacheStatus.NonPrefetch.FromPrecache",
+ HttpResponseInfo::CacheEntryStatus::ENTRY_USED);
ExpectNewSample("Precache.Saved", kSize);
ExpectNewSample("Precache.Saved.Freshness", kFreshnessBucket10K);
ExpectNoOtherSamples();
@@ -365,6 +371,8 @@ TEST_F(PrecacheDatabaseTest, FetchFromCacheWithURLTableEntry_Cellular) {
ExpectNewSample("Precache.Latency.NonPrefetch.NonTopHosts", 0);
ExpectNewSample("Precache.CacheStatus.NonPrefetch",
HttpResponseInfo::CacheEntryStatus::ENTRY_USED);
+ ExpectNewSample("Precache.CacheStatus.NonPrefetch.FromPrecache",
+ HttpResponseInfo::CacheEntryStatus::ENTRY_USED);
ExpectNewSample("Precache.Saved", kSize);
ExpectNewSample("Precache.Saved.Cellular", kSize);
ExpectNewSample("Precache.Saved.Freshness", kFreshnessBucket10K);
« no previous file with comments | « components/precache/core/precache_database.cc ('k') | components/precache/core/precache_url_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698