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

Unified Diff: chrome/browser/net/predictor_browsertest.cc

Issue 874163005: Fix DNS Prefetch in Chrome: new message type not added to filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: end-to-end prefetch test Created 5 years, 10 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 | « no previous file | chrome/browser/renderer_host/chrome_render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor_browsertest.cc
diff --git a/chrome/browser/net/predictor_browsertest.cc b/chrome/browser/net/predictor_browsertest.cc
index fe5d0d98ad66856bcdf3b25ca0d596fb5c14d046..50474a19e2ad7c9dc5946e7841c863f351bb5088 100644
--- a/chrome/browser/net/predictor_browsertest.cc
+++ b/chrome/browser/net/predictor_browsertest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/ui_test_utils.h"
#include "content/public/test/test_utils.h"
#include "net/base/net_errors.h"
#include "net/dns/host_resolver_proc.h"
@@ -20,6 +21,8 @@ using testing::HasSubstr;
namespace {
+const char[] kChromiumHostname = "chromium.org";
+
// Records a history of all hostnames for which resolving has been requested,
// and immediately fails the resolution requests themselves.
class HostResolutionRequestRecorder : public net::HostResolverProc {
@@ -105,6 +108,7 @@ class PredictorBrowserTest : public InProcessBrowserTest {
void SetUpInProcessBrowserTestFixture() override {
scoped_host_resolver_proc_.reset(new net::ScopedDefaultHostResolverProc(
host_resolution_request_recorder_.get()));
+ ASSERT_TRUE(test_server()->Start());
Nico 2015/02/06 02:06:47 (if you only need this in that one test, consider
gunsch 2015/02/06 02:10:10 Done.
InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
}
@@ -189,5 +193,12 @@ IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, ShutdownStartupCycle) {
WaitUntilHostHasBeenRequested(target_url_.host());
}
+IN_PROC_BROWSER_TEST_F(PredictorBrowserTest, DnsPrefetch) {
+ ui_test_utils::NavigateToURL(
+ browser(),
+ GURL(test_server()->GetURL("files/predictor/dns_prefetch.html")));
+ WaitUntilHostHasBeenRequested(kChromiumHostname);
+}
+
} // namespace chrome_browser_net
« no previous file with comments | « no previous file | chrome/browser/renderer_host/chrome_render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698