Chromium Code Reviews| Index: net/url_request/url_request_test_util.cc |
| diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc |
| index cc56ef300f17749a68d8e34a8ad93fb986611921..336514659c59a64686171307d63c9cfb030992b9 100644 |
| --- a/net/url_request/url_request_test_util.cc |
| +++ b/net/url_request/url_request_test_util.cc |
| @@ -4,6 +4,8 @@ |
| #include "net/url_request/url_request_test_util.h" |
| +#include <map> |
| +#include <string> |
| #include <utility> |
| #include "base/compiler_specific.h" |
| @@ -24,6 +26,7 @@ |
| #include "net/http/http_response_headers.h" |
| #include "net/http/http_server_properties_impl.h" |
| #include "net/http/transport_security_state.h" |
| +#include "net/nqe/external_estimate_provider.h" |
| #include "net/proxy/proxy_retry_info.h" |
| #include "net/ssl/channel_id_service.h" |
| #include "net/ssl/default_channel_id_store.h" |
| @@ -57,7 +60,9 @@ const int kStageDestruction = 1 << 10; |
| TestURLRequestContext::TestURLRequestContext() : TestURLRequestContext(false) {} |
| TestURLRequestContext::TestURLRequestContext(bool delay_initialization) |
| - : context_storage_(this) { |
| + : network_quality_estimator_(std::unique_ptr<ExternalEstimateProvider>(), |
| + std::map<std::string, std::string>()), |
| + context_storage_(this) { |
| if (!delay_initialization) |
| Init(); |
| } |
| @@ -112,6 +117,10 @@ void TestURLRequestContext::Init() { |
| new DefaultChannelIDStore(nullptr), |
| base::WorkerPool::GetTaskRunner(true))); |
| } |
| + |
| + if (!network_quality_estimator()) |
| + set_network_quality_estimator(&network_quality_estimator_); |
| + |
| if (http_transaction_factory()) { |
| // Make sure we haven't been passed an object we're not going to use. |
| EXPECT_FALSE(client_socket_factory_); |
| @@ -133,6 +142,8 @@ void TestURLRequestContext::Init() { |
| params.http_server_properties = http_server_properties(); |
| params.net_log = net_log(); |
| params.channel_id_service = channel_id_service(); |
| + params.socket_performance_watcher_factory = |
|
tbansal1
2016/11/14 20:26:01
Currently, the problem is that in some tests, |par
mmenke
2016/11/14 20:29:52
A better solution instead of this CL, or in additi
tbansal1
2016/11/14 20:39:27
"In addition to". OK, I will do that after this CL
|
| + network_quality_estimator()->GetSocketPerformanceWatcherFactory(); |
| context_storage_.set_http_network_session( |
| base::MakeUnique<HttpNetworkSession>(params)); |
| context_storage_.set_http_transaction_factory(base::MakeUnique<HttpCache>( |