Index: chrome/browser/net/predictor_browsertest.cc |
diff --git a/chrome/browser/net/predictor_browsertest.cc b/chrome/browser/net/predictor_browsertest.cc |
index 94d389ff2ac4065dbbc1863dafd942c65d8286ae..de11dfc6e39063844d769202e047833674c15e0f 100644 |
--- a/chrome/browser/net/predictor_browsertest.cc |
+++ b/chrome/browser/net/predictor_browsertest.cc |
@@ -54,6 +54,10 @@ class HostResolutionRequestRecorder : public net::HostResolverProc { |
return net::ERR_NAME_NOT_RESOLVED; |
} |
+ int RequestedHostnameCount() const { |
+ return requested_hostnames_.size(); |
+ } |
+ |
bool HasHostBeenRequested(const std::string& hostname) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
return std::find(requested_hostnames_.begin(), |
@@ -214,6 +218,10 @@ class PredictorBrowserTest : public InProcessBrowserTest { |
host_resolution_request_recorder_->WaitUntilHostHasBeenRequested(hostname); |
} |
+ int RequestedHostnameCount() const { |
+ return host_resolution_request_recorder_->RequestedHostnameCount(); |
+ } |
+ |
const GURL startup_url_; |
const GURL referring_url_; |
const GURL target_url_; |
@@ -254,10 +262,12 @@ IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, ShutdownStartupCycle) { |
IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, DnsPrefetch) { |
ASSERT_TRUE(test_server()->Start()); |
+ int hostnames_requested_before_load = RequestedHostnameCount(); |
ui_test_utils::NavigateToURL( |
browser(), |
GURL(test_server()->GetURL("files/predictor/dns_prefetch.html"))); |
WaitUntilHostHasBeenRequested(kChromiumHostname); |
+ ASSERT_EQ(hostnames_requested_before_load + 1, RequestedHostnameCount()); |
} |
IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, Preconnect) { |