| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
|
| index 3fe3fce5cdb21aa1350acf4c099628ad8d80818f..86063221003ab963f83345952d02640f98b9e5b4 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
|
| @@ -44,6 +44,7 @@
|
| #include "net/http/http_util.h"
|
| #include "net/nqe/effective_connection_type.h"
|
| #include "net/nqe/network_quality_estimator.h"
|
| +#include "net/nqe/network_quality_estimator_test_util.h"
|
| #include "net/proxy/proxy_config.h"
|
| #include "net/proxy/proxy_info.h"
|
| #include "net/proxy/proxy_retry_info.h"
|
| @@ -141,28 +142,6 @@ class TestLoFiUIService : public LoFiUIService {
|
| bool on_lofi_response_;
|
| };
|
|
|
| -// Overrides net::NetworkQualityEstimator for testing.
|
| -class TestNetworkQualityEstimator : public net::NetworkQualityEstimator {
|
| - public:
|
| - TestNetworkQualityEstimator(
|
| - const std::map<std::string, std::string>& variation_params,
|
| - net::EffectiveConnectionType effective_connection_type)
|
| - : NetworkQualityEstimator(
|
| - std::unique_ptr<net::ExternalEstimateProvider>(),
|
| - variation_params),
|
| - effective_connection_type_(effective_connection_type) {}
|
| -
|
| - ~TestNetworkQualityEstimator() override {}
|
| -
|
| - net::EffectiveConnectionType GetEffectiveConnectionType() const override {
|
| - return effective_connection_type_;
|
| - }
|
| -
|
| - private:
|
| - // Estimate of the quality of the network.
|
| - net::EffectiveConnectionType effective_connection_type_;
|
| -};
|
| -
|
| class DataReductionProxyNetworkDelegateTest : public testing::Test {
|
| public:
|
| DataReductionProxyNetworkDelegateTest()
|
| @@ -533,8 +512,9 @@ TEST_F(DataReductionProxyNetworkDelegateTest, RequestDataConfigurations) {
|
| net::ProxyRetryInfoMap proxy_retry_info;
|
|
|
| std::map<std::string, std::string> network_quality_estimator_params;
|
| - TestNetworkQualityEstimator test_network_quality_estimator(
|
| - network_quality_estimator_params,
|
| + net::TestNetworkQualityEstimator test_network_quality_estimator(
|
| + network_quality_estimator_params);
|
| + test_network_quality_estimator.set_effective_connection_type(
|
| net::EFFECTIVE_CONNECTION_TYPE_OFFLINE);
|
| context()->set_network_quality_estimator(&test_network_quality_estimator);
|
|
|
| @@ -621,8 +601,10 @@ TEST_F(DataReductionProxyNetworkDelegateTest, RedirectRequestDataCleared) {
|
| net::ProxyRetryInfoMap proxy_retry_info;
|
|
|
| std::map<std::string, std::string> network_quality_estimator_params;
|
| - TestNetworkQualityEstimator test_network_quality_estimator(
|
| - network_quality_estimator_params, net::EFFECTIVE_CONNECTION_TYPE_OFFLINE);
|
| + net::TestNetworkQualityEstimator test_network_quality_estimator(
|
| + network_quality_estimator_params);
|
| + test_network_quality_estimator.set_effective_connection_type(
|
| + net::EFFECTIVE_CONNECTION_TYPE_OFFLINE);
|
| context()->set_network_quality_estimator(&test_network_quality_estimator);
|
|
|
| std::unique_ptr<net::URLRequest> request = context()->CreateRequest(
|
|
|