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

Unified Diff: components/cronet/url_request_context_config_unittest.cc

Issue 1817553002: Add host resolver rules experimental flag for Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix error caused by conflicting change, and rebase 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
Index: components/cronet/url_request_context_config_unittest.cc
diff --git a/components/cronet/url_request_context_config_unittest.cc b/components/cronet/url_request_context_config_unittest.cc
index 8989d0188267ab4fb043a195c3242ac2b8975508..ac3295eaedb250aa76849f4c27f2c5513a6a871f 100644
--- a/components/cronet/url_request_context_config_unittest.cc
+++ b/components/cronet/url_request_context_config_unittest.cc
@@ -100,6 +100,54 @@ TEST(URLRequestContextConfigTest, SetQuicExperimentalOptions) {
EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue());
}
+TEST(URLRequestContextConfigTest, SetDNSExperimentalOptions) {
pauljensen 2016/04/07 16:29:15 how about we just merge this into SetQuicExperimen
mgersh 2016/06/08 18:31:14 Done.
+ URLRequestContextConfig config(
+ // Enable QUIC.
+ true,
+ // QUIC User Agent ID.
+ "Default QUIC User Agent ID",
+ // Enable SPDY.
+ true,
+ // Enable SDCH.
+ false,
+ // Type of http cache.
+ URLRequestContextConfig::HttpCacheType::DISK,
+ // Max size of http cache in bytes.
+ 1024000,
+ // Disable caching for HTTP responses. Other information may be stored in
+ // the cache.
+ false,
+ // Storage path for http cache and cookie storage.
+ "/data/data/org.chromium.net/app_cronet_test/test_storage",
+ // User-Agent request header field.
+ "fake agent",
+ // JSON encoded experimental options.
+ "{\"AsyncDNS\":{\"enable\":true},"
+ "\"HostResolverRules\":{\"host_resolver_rules\":"
+ "\"MAP * 127.0.0.1\"}}",
+ // Data reduction proxy key.
+ "",
+ // Data reduction proxy.
+ "",
+ // Fallback data reduction proxy.
+ "",
+ // Data reduction proxy secure proxy check URL.
+ "",
+ // MockCertVerifier to use for testing purposes.
+ scoped_ptr<net::CertVerifier>());
+
+ net::URLRequestContextBuilder builder;
+ net::NetLog net_log;
+ config.ConfigureURLRequestContextBuilder(&builder, &net_log, nullptr);
+ // Set a ProxyConfigService to avoid DCHECK failure when building.
+ builder.set_proxy_config_service(make_scoped_ptr(
+ new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect())));
+ scoped_ptr<net::URLRequestContext> context(builder.Build());
+
+ // Check that AsyncDNS is still enabled when host resolver rules are used
+ EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue());
+}
+
TEST(URLRequestContextConfigTest, SetQuicConnectionMigrationOptions) {
URLRequestContextConfig config(
// Enable QUIC.

Powered by Google App Engine
This is Rietveld 408576698