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

Unified Diff: headless/lib/headless_browser_browsertest.cc

Issue 1912673002: headless: Add support for host resolver mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased again Created 4 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
« no previous file with comments | « headless/lib/browser/headless_url_request_context_getter.cc ('k') | headless/public/headless_browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_browser_browsertest.cc
diff --git a/headless/lib/headless_browser_browsertest.cc b/headless/lib/headless_browser_browsertest.cc
index f7899f24e024bd29856df2aa283c988eff6ea3b8..f2df50b294d8bafd16cd0bd87e4134fdc9b75b3e 100644
--- a/headless/lib/headless_browser_browsertest.cc
+++ b/headless/lib/headless_browser_browsertest.cc
@@ -78,4 +78,17 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTestWithProxy, SetProxyServer) {
EXPECT_TRUE(browser()->GetAllWebContents().empty());
}
+IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, SetHostResolverRules) {
+ EXPECT_TRUE(embedded_test_server()->Start());
+ HeadlessBrowser::Options::Builder builder;
+ builder.SetHostResolverRules("MAP not-an-actual-domain.tld 127.0.0.1");
+ SetBrowserOptions(builder.Build());
+
+ // Load a page which doesn't actually exist, but which is turned into a valid
+ // address by our host resolver rules.
+ HeadlessWebContents* web_contents = browser()->CreateWebContents(
+ GURL("http://not-an-actual-domain.tld/hello.html"), gfx::Size(800, 600));
+ EXPECT_TRUE(WaitForLoad(web_contents));
+}
+
} // namespace headless
« no previous file with comments | « headless/lib/browser/headless_url_request_context_getter.cc ('k') | headless/public/headless_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698