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

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: delete registerHostResolverProc and rebase Created 4 years, 5 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 a0cef2abd3d616e890b8e029db4205f8f90d0382..fc7a25049f02970269ccc33df1d73b6e8b30c39f 100644
--- a/components/cronet/url_request_context_config_unittest.cc
+++ b/components/cronet/url_request_context_config_unittest.cc
@@ -16,7 +16,7 @@
namespace cronet {
-TEST(URLRequestContextConfigTest, SetQuicExperimentalOptions) {
+TEST(URLRequestContextConfigTest, TestExperimentalOptionPassing) {
URLRequestContextConfig config(
// Enable QUIC.
true,
@@ -47,7 +47,9 @@ TEST(URLRequestContextConfigTest, SetQuicExperimentalOptions) {
"\"idle_connection_timeout_seconds\":300,"
"\"close_sessions_on_ip_change\":true,"
"\"connection_options\":\"TIME,TBBR,REJ\"},"
- "\"AsyncDNS\":{\"enable\":true}}",
+ "\"AsyncDNS\":{\"enable\":true},"
+ "\"HostResolverRules\":{\"host_resolver_rules\":"
+ "\"MAP * 127.0.0.1\"}}",
// Data reduction proxy key.
"",
// Data reduction proxy.
@@ -105,6 +107,11 @@ TEST(URLRequestContextConfigTest, SetQuicExperimentalOptions) {
// Check AsyncDNS resolver is enabled.
EXPECT_TRUE(context->host_resolver()->GetDnsConfigAsValue());
+
+ net::HostResolver::RequestInfo info(net::HostPortPair("abcde", 80));
+ net::AddressList addresses;
+ EXPECT_EQ(net::OK, context->host_resolver()->ResolveFromCache(
+ info, &addresses, net::BoundNetLog()));
}
TEST(URLRequestContextConfigTest, SetQuicConnectionMigrationOptions) {

Powered by Google App Engine
This is Rietveld 408576698