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

Unified Diff: components/cronet/url_request_context_config_unittest.cc

Issue 1429863008: [Cronet] Remove JSON serialization of CronetEngine.Builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component_unittests Created 5 years 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 | « components/cronet/url_request_context_config_list.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ac4ace515a92decc810514e528f67fafe7cba030..bb88ec2c78c31df1961f0e22bb73254ae443834d 100644
--- a/components/cronet/url_request_context_config_unittest.cc
+++ b/components/cronet/url_request_context_config_unittest.cc
@@ -4,6 +4,7 @@
#include "components/cronet/url_request_context_config.h"
+#include "net/cert/cert_verifier.h"
#include "net/http/http_network_session.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_config_service_fixed.h"
@@ -14,25 +15,41 @@
namespace cronet {
TEST(URLRequestContextConfigTest, SetQuicExperimentalOptions) {
- URLRequestContextConfig config;
-
- std::string args =
- "{\"QUIC_HINTS\":[{\"QUIC_HINT_ALT_PORT\":6121,\"QUIC_HINT_PORT\":6121,"
- "\"QUIC_HINT_HOST\":\"test.example.com\"}],"
- "\"HTTP_CACHE\":\"HTTP_CACHE_DISK\",\"ENABLE_SDCH\":false,"
- "\"ENABLE_LEGACY_MODE\":false,\"HTTP_CACHE_MAX_SIZE\":1024000,"
- "\"NATIVE_LIBRARY_NAME\":\"cronet_tests\",\"USER_AGENT\":\"fake agent\","
- "\"STORAGE_PATH\":"
- "\"\\/data\\/data\\/org.chromium.net\\/app_cronet_test\\/test_storage\","
- "\"ENABLE_SPDY\":true,"
- "\"ENABLE_QUIC\":true,\"LOAD_DISABLE_CACHE\":true,"
- "\"EXPERIMENTAL_OPTIONS\":"
- "\"{\\\"QUIC\\\":{\\\"store_server_configs_in_properties\\\":true,"
- "\\\"delay_tcp_race\\\":true,"
- "\\\"max_number_of_lossy_connections\\\":10,"
- "\\\"packet_loss_threshold\\\":0.5,"
- "\\\"connection_options\\\":\\\"TIME,TBBR,REJ\\\"}}\"}";
- config.LoadFromJSON(args);
+ URLRequestContextConfig config(
+ // Enable QUIC.
+ true,
+ // 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.
+ "{\"QUIC\":{\"store_server_configs_in_properties\":true,"
+ "\"delay_tcp_race\":true,"
+ "\"max_number_of_lossy_connections\":10,"
+ "\"packet_loss_threshold\":0.5,"
+ "\"connection_options\":\"TIME,TBBR,REJ\"}}",
+ // 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;
config.ConfigureURLRequestContextBuilder(&builder);
// Set a ProxyConfigService to avoid DCHECK failure when building.
« no previous file with comments | « components/cronet/url_request_context_config_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698