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

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

Issue 2545943003: Accessing navigation information via webcontents (Closed)
Patch Set: Post-Review Modifications Created 4 years 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
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 a6c3d65a5ff7af001b08c7ecdedd9aa23ab6e771..95f9d0bab6de2235bf16c7e533ed1615021fd586 100644
--- a/chrome/browser/predictors/resource_prefetcher_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc
@@ -7,11 +7,13 @@
#include <stddef.h>
#include <memory>
+#include <string>
#include <utility>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h"
#include "chrome/browser/predictors/resource_prefetcher_manager.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
@@ -150,7 +152,8 @@ ResourcePrefetcherTest::~ResourcePrefetcherTest() {
}
TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
- GURL main_frame_url("http://www.google.com");
+ std::string main_frame_url_string("http://www.google.com");
+ GURL main_frame_url(main_frame_url_string);
Benoit L 2016/12/06 14:58:18 nit: You can use main_frame_url.spec() to avoid ad
ahemery 2016/12/06 15:17:38 Simplified
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,7 +167,7 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
GURL("http://yahoo.com/resource4.png"),
GURL("http://yahoo.com/resource5.png")};
- NavigationID navigation_id(1, 2, main_frame_url);
+ NavigationID navigation_id = CreateNavigationID(1, 2, main_frame_url_string);
prefetcher_.reset(new TestResourcePrefetcher(&prefetcher_delegate_, config_,
main_frame_url, urls));
@@ -228,7 +231,8 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherFinishes) {
}
TEST_F(ResourcePrefetcherTest, TestPrefetcherStopped) {
- GURL main_frame_url("http://www.google.com");
+ std::string main_frame_url_string("http://www.google.com");
Benoit L 2016/12/06 14:58:18 nit: ditto.
+ GURL main_frame_url(main_frame_url_string);
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,7 +240,7 @@ TEST_F(ResourcePrefetcherTest, TestPrefetcherStopped) {
GURL("http://yahoo.com/resource3.png"),
GURL("http://m.google.com/resource1.jpg")};
- NavigationID navigation_id(1, 2, main_frame_url);
+ NavigationID navigation_id = CreateNavigationID(1, 2, main_frame_url_string);
prefetcher_.reset(new TestResourcePrefetcher(&prefetcher_delegate_, config_,
main_frame_url, urls));

Powered by Google App Engine
This is Rietveld 408576698