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

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: 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 9cc594073cef0d6aa78bdb2c4ff4f8c6b55923ad..b53fa24ec27ea572f7a11258a42f2e87e48b5fe6 100644
--- a/headless/lib/headless_browser_browsertest.cc
+++ b/headless/lib/headless_browser_browsertest.cc
@@ -67,4 +67,19 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTestWithProxy, SetProxyServer) {
EXPECT_TRUE(WaitForLoad(web_contents.get()));
}
+IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, SetProxyServer) {
altimin 2016/04/21 14:35:55 Nit: maybe we can come up with a better name for t
Sami 2016/04/21 14:58:37 Hmm, not a bad idea :D
+ 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.
+ std::unique_ptr<HeadlessWebContents> web_contents =
+ browser()->CreateWebContents(
+ GURL("http://not-an-actual-domain.tld/hello.html"),
+ gfx::Size(800, 600));
+ EXPECT_TRUE(WaitForLoad(web_contents.get()));
+}
+
} // 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