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

Unified Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 2838293002: Ensure all content_browsertests call the host resolver in SetUpOnMainThread and not after. (Closed)
Patch Set: Created 3 years, 8 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
Index: content/browser/web_contents/web_contents_impl_browsertest.cc
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc
index cb7fccecf4dbbe6f119f7c56c64acb0c1430d56b..71c3c4239040f8529b97f593f4c3c8eac826e64a 100644
--- a/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -68,6 +68,12 @@ class WebContentsImplBrowserTest : public ContentBrowserTest {
ContentBrowserTest::SetUp();
}
+ void SetUpOnMainThread() override {
+ // Setup the server to allow serving separate sites, so we can perform
+ // cross-process navigation.
+ host_resolver()->AddRule("*", "127.0.0.1");
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(WebContentsImplBrowserTest);
};
@@ -436,9 +442,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
net::HostPortPair foo_host_port;
GURL cross_site_url;
- // Setup the server to allow serving separate sites, so we can perform
- // cross-process navigation.
- host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->Start());
foo_host_port = embedded_test_server()->host_port_pair();
@@ -594,7 +597,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, LoadProgressWithFrames) {
// a DidStopLoading. See http://crbug.com/429399.
IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
LoadProgressAfterInterruptedNav) {
- host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->Start());
// Start at a real page.
@@ -1002,7 +1004,6 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
TestJavaScriptDialogManager dialog_manager;
wc->SetDelegate(&dialog_manager);
- host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->Start());
NavigateToURL(shell(),
@@ -1281,7 +1282,6 @@ class MouseLockDelegate : public WebContentsDelegate {
IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
RenderWidgetDeletedWhileMouseLockPending) {
- host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->Start());
std::unique_ptr<MouseLockDelegate> delegate(new MouseLockDelegate());
« no previous file with comments | « content/browser/web_contents/opened_by_dom_browsertest.cc ('k') | content/test/browser_test_utils_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698