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

Unified Diff: components/precache/content/precache_manager_unittest.cc

Issue 2762673002: predictors: Pass manifests from Bork to store in ResourcePrefetchPredictor. (Closed)
Patch Set: Add delegate tests for PrecacheFetcher. Created 3 years, 9 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/content/precache_manager.cc ('k') | components/precache/core/precache_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/content/precache_manager_unittest.cc
diff --git a/components/precache/content/precache_manager_unittest.cc b/components/precache/content/precache_manager_unittest.cc
index 67ef094a92022cc5d60b53aff5aec3fc12bbd735..4c3981260a8cd583e21b5307731d53e07fbad17c 100644
--- a/components/precache/content/precache_manager_unittest.cc
+++ b/components/precache/content/precache_manager_unittest.cc
@@ -107,6 +107,12 @@ class MockHistoryService : public history::HistoryService {
const base::Callback<void(int)>& callback));
};
+class MockPrecacheManagerDelegate : public PrecacheManager::Delegate {
+ public:
+ MOCK_METHOD2(OnManifestFetched,
+ void(const std::string& host, const PrecacheManifest& manifest));
+};
+
ACTION_P(ReturnHosts, starting_hosts) {
arg1.Run(starting_hosts);
}
@@ -138,12 +144,14 @@ class PrecacheManagerUnderTest : public PrecacheManager {
const history::HistoryService* history_service,
const data_reduction_proxy::DataReductionProxySettings*
data_reduction_proxy_settings,
+ Delegate* delegate_,
const base::FilePath& db_path,
std::unique_ptr<PrecacheDatabase> precache_database)
: PrecacheManager(browser_context,
sync_service,
history_service,
data_reduction_proxy_settings,
+ delegate_,
db_path,
std::move(precache_database)),
control_group_(false) {}
@@ -202,7 +210,8 @@ class PrecacheManagerTest : public testing::Test {
base::FilePath(FILE_PATH_LITERAL("precache_database")));
precache_manager_.reset(new PrecacheManagerUnderTest(
&browser_context_, nullptr /* sync_service */, &history_service_,
- nullptr /* data_reduction_proxy_settings */, db_path,
+ nullptr /* data_reduction_proxy_settings */,
+ &precache_manager_delegate_, db_path,
base::WrapUnique(precache_database)));
}
@@ -246,6 +255,7 @@ class PrecacheManagerTest : public testing::Test {
net::FakeURLFetcherFactory factory_;
TestPrecacheCompletionCallback precache_callback_;
testing::NiceMock<MockHistoryService> history_service_;
+ testing::NiceMock<MockPrecacheManagerDelegate> precache_manager_delegate_;
base::HistogramTester histograms_;
net::HttpResponseInfo info_;
variations::testing::VariationParamsManager variation_params_;
« no previous file with comments | « components/precache/content/precache_manager.cc ('k') | components/precache/core/precache_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698