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

Unified Diff: content/browser/web_contents/opened_by_dom_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/opened_by_dom_browsertest.cc
diff --git a/content/browser/web_contents/opened_by_dom_browsertest.cc b/content/browser/web_contents/opened_by_dom_browsertest.cc
index 699121da96fa3502a995b1a1f583153db0fdf2ab..0f506b50b4101fa5f3f40f52059681a522bef7d5 100644
--- a/content/browser/web_contents/opened_by_dom_browsertest.cc
+++ b/content/browser/web_contents/opened_by_dom_browsertest.cc
@@ -47,6 +47,10 @@ class OpenedByDOMTest : public ContentBrowserTest {
IsolateAllSitesForTesting(command_line);
}
+ void SetUpOnMainThread() override {
+ host_resolver()->AddRule("*", "127.0.0.1");
+ }
+
bool AttemptCloseFromJavaScript(WebContents* web_contents) {
CloseTrackingDelegate close_tracking_delegate;
WebContentsDelegate* old_delegate = web_contents->GetDelegate();
@@ -114,7 +118,6 @@ IN_PROC_BROWSER_TEST_F(OpenedByDOMTest, Popup) {
// Tests that window.close() works in a popup window that has navigated a few
// times and swapped processes.
IN_PROC_BROWSER_TEST_F(OpenedByDOMTest, CrossProcessPopup) {
- host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(embedded_test_server()->Start());
GURL url1 = embedded_test_server()->GetURL("/site_isolation/blank.html?1");

Powered by Google App Engine
This is Rietveld 408576698