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

Unified Diff: chrome/browser/predictors/resource_prefetcher_unittest.cc

Issue 2373443002: predictors: Key the resource prefetcher by URL, not navigation. (Closed)
Patch Set: Created 4 years, 3 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 | « chrome/browser/predictors/resource_prefetcher_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/predictors/resource_prefetcher_unittest.cc
diff --git a/chrome/browser/predictors/resource_prefetcher_unittest.cc b/chrome/browser/predictors/resource_prefetcher_unittest.cc
index b67f1de917b742076c6ece88e437ca4ced05fc8d..6265782cf99dd10b66e243650138bbdd27e6f9bd 100644
--- a/chrome/browser/predictors/resource_prefetcher_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc
@@ -33,10 +33,9 @@ class TestResourcePrefetcher : public ResourcePrefetcher {
public:
TestResourcePrefetcher(ResourcePrefetcher::Delegate* delegate,
const ResourcePrefetchPredictorConfig& config,
- const NavigationID& navigation_id,
- PrefetchKeyType key_type,
+ const GURL& main_frame_url,
const std::vector<GURL>& urls)
- : ResourcePrefetcher(delegate, config, navigation_id, key_type, urls) {}
+ : ResourcePrefetcher(delegate, config, main_frame_url, urls) {}
~TestResourcePrefetcher() override {}
@@ -151,6 +150,7 @@ ResourcePrefetcherTest::~ResourcePrefetcherTest() {
}
TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
+ GURL main_frame_url("http://www.google.com");
std::vector<GURL> urls = {GURL("http://www.google.com/resource1.html"),
GURL("http://www.google.com/resource2.png"),
GURL("http://yahoo.com/resource1.png"),
@@ -164,11 +164,10 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
GURL("http://yahoo.com/resource4.png"),
GURL("http://yahoo.com/resource5.png")};
- NavigationID navigation_id(1, 2, GURL("http://www.google.com"));
+ NavigationID navigation_id(1, 2, main_frame_url);
prefetcher_.reset(new TestResourcePrefetcher(&prefetcher_delegate_, config_,
- navigation_id,
- PREFETCH_KEY_TYPE_URL, urls));
+ main_frame_url, urls));
// Starting the prefetcher maxes out the number of possible requests.
AddStartUrlRequestExpectation("http://www.google.com/resource1.html");
@@ -229,6 +228,7 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
}
TEST_F(ResourcePrefetcherTest, TestPrefetcherStopped) {
+ GURL main_frame_url("http://www.google.com");
std::vector<GURL> urls = {GURL("http://www.google.com/resource1.html"),
GURL("http://www.google.com/resource2.png"),
GURL("http://yahoo.com/resource1.png"),
@@ -236,11 +236,10 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherStopped) {
GURL("http://yahoo.com/resource3.png"),
GURL("http://m.google.com/resource1.jpg")};
- NavigationID navigation_id(1, 2, GURL("http://www.google.com"));
+ NavigationID navigation_id(1, 2, main_frame_url);
prefetcher_.reset(new TestResourcePrefetcher(&prefetcher_delegate_, config_,
- navigation_id,
- PREFETCH_KEY_TYPE_HOST, urls));
+ main_frame_url, urls));
// Starting the prefetcher maxes out the number of possible requests.
AddStartUrlRequestExpectation("http://www.google.com/resource1.html");
« no previous file with comments | « chrome/browser/predictors/resource_prefetcher_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698