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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
index f67548f5623f2c8c255a51ab026cd2a08a039660..d3b9b1a9053fd4146b340701e32878eaef374cae 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc
@@ -14,32 +14,34 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/test/histogram_tester.h"
#include "base/test/mock_entropy_provider.h"
#include "base/time/time.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_test_utils.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_client_config_parser.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/data_reduction_proxy/proto/client_config.pb.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_server.h"
#include "net/socket/socket_test_util.h"
#include "net/url_request/url_request_context_storage.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
// The following values should match those in
// DataReductionProxyConfigServiceClientTest.config_:
const char kSuccessOrigin[] = "https://origin.net:443";
const char kSuccessFallback[] = "fallback.net:80";
@@ -125,36 +127,36 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test {
mock_socket_factory_.reset(nullptr);
test_context_ =
DataReductionProxyTestContext::Builder()
.WithParamsDefinitions(TestDataReductionProxyParams::HAS_EVERYTHING)
.WithURLRequestContext(context_.get())
.WithMockClientSocketFactory(mock_socket_factory_.get())
.WithTestConfigurator()
.WithMockRequestOptions()
.WithTestConfigClient()
.Build();
+
context_->set_client_socket_factory(mock_socket_factory_.get());
test_context_->AttachToURLRequestContext(context_storage_.get());
+ delegate_ = test_context_->io_data()->CreateProxyDelegate();
+ context_->set_proxy_delegate(delegate_.get());
+
context_->Init();
ResetBackoffEntryReleaseTime();
test_context_->test_config_client()->SetNow(base::Time::UnixEpoch());
test_context_->test_config_client()->SetEnabled(true);
enabled_proxies_for_http_ =
test_context_->test_params()->proxies_for_http();
test_context_->test_config_client()->SetConfigServiceURL(
GURL("http://configservice.com"));
- delegate_.reset(
- new DataReductionProxyDelegate(request_options(), config()));
-
ASSERT_NE(nullptr, context_->network_delegate());
-
// Set up the various test ClientConfigs.
ClientConfig config =
CreateConfig(kSuccessSessionKey, kConfigRefreshDurationSeconds, 0,
ProxyServer_ProxyScheme_HTTPS, "origin.net", 443,
ProxyServer_ProxyScheme_HTTP, "fallback.net", 80);
config.SerializeToString(&config_);
encoded_config_ = EncodeConfig(config);
ClientConfig previous_config =
CreateConfig(kOldSuccessSessionKey, kConfigRefreshDurationSeconds, 0,

Powered by Google App Engine
This is Rietveld 408576698