| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
|
| index 7d378f711d5a2ae95a1ec2df2d22520317fa5405..aff833d5d6599d5488bad0387448e70b0c7d6971 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_protocol_unittest.cc
|
| @@ -22,20 +22,21 @@
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
|
| #include "net/base/completion_callback.h"
|
| #include "net/base/host_port_pair.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/base/network_change_notifier.h"
|
| #include "net/base/network_delegate.h"
|
| +#include "net/base/proxy_delegate.h"
|
| #include "net/http/http_response_headers.h"
|
| #include "net/http/http_transaction_test_util.h"
|
| #include "net/proxy/proxy_server.h"
|
| #include "net/proxy/proxy_service.h"
|
| #include "net/socket/socket_test_util.h"
|
| #include "net/url_request/static_http_user_agent_settings.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_context.h"
|
| #include "net/url_request/url_request_context_storage.h"
|
| #include "net/url_request/url_request_filter.h"
|
| @@ -775,20 +776,22 @@ class DataReductionProxyBypassProtocolEndToEndTest : public testing::Test {
|
| void ResetDependencies() {
|
| context_.reset(new net::TestURLRequestContext(true));
|
| storage_.reset(new net::URLRequestContextStorage(context_.get()));
|
| mock_socket_factory_.reset(new net::MockClientSocketFactory());
|
| context_->set_client_socket_factory(mock_socket_factory_.get());
|
| drp_test_context_ =
|
| DataReductionProxyTestContext::Builder()
|
| .WithMockClientSocketFactory(mock_socket_factory_.get())
|
| .WithURLRequestContext(context_.get())
|
| .Build();
|
| + proxy_delegate_ = drp_test_context_->io_data()->CreateProxyDelegate();
|
| + context_->set_proxy_delegate(proxy_delegate_.get());
|
| }
|
|
|
| void AttachToContextAndInit() {
|
| drp_test_context_->AttachToURLRequestContext(storage_.get());
|
| context_->Init();
|
| }
|
|
|
| net::TestURLRequestContext* context() { return context_.get(); }
|
| net::URLRequestContextStorage* storage() { return storage_.get(); }
|
| net::MockClientSocketFactory* mock_socket_factory() {
|
| @@ -796,20 +799,21 @@ class DataReductionProxyBypassProtocolEndToEndTest : public testing::Test {
|
| }
|
| DataReductionProxyTestContext* drp_test_context() {
|
| return drp_test_context_.get();
|
| }
|
|
|
| private:
|
| base::MessageLoopForIO loop_;
|
| scoped_ptr<net::TestURLRequestContext> context_;
|
| scoped_ptr<net::URLRequestContextStorage> storage_;
|
| scoped_ptr<net::MockClientSocketFactory> mock_socket_factory_;
|
| + scoped_ptr<net::ProxyDelegate> proxy_delegate_;
|
| scoped_ptr<DataReductionProxyTestContext> drp_test_context_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DataReductionProxyBypassProtocolEndToEndTest);
|
| };
|
|
|
| TEST_F(DataReductionProxyBypassProtocolEndToEndTest,
|
| BypassLogicAlwaysAppliesWhenViaHeaderPresent) {
|
| const struct {
|
| const char* first_response;
|
| bool expected_retry;
|
|
|