| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
|
| index 66f6a944241042bab86f028934e2a203433a4702..1966e07226f5d5efa132be1404385e31f6c0fc9e 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
|
| @@ -282,20 +282,22 @@ class DataReductionProxyInterceptorEndToEndTest : public testing::Test {
|
| ~DataReductionProxyInterceptorEndToEndTest() override {}
|
|
|
| void SetUp() override {
|
| drp_test_context_ =
|
| DataReductionProxyTestContext::Builder()
|
| .WithURLRequestContext(&context_)
|
| .WithMockClientSocketFactory(&mock_socket_factory_)
|
| .Build();
|
| drp_test_context_->AttachToURLRequestContext(&context_storage_);
|
| context_.set_client_socket_factory(&mock_socket_factory_);
|
| + proxy_delegate_ = drp_test_context_->io_data()->CreateProxyDelegate();
|
| + context_.set_proxy_delegate(proxy_delegate_.get());
|
| context_.Init();
|
| drp_test_context_->EnableDataReductionProxyWithSecureProxyCheckSuccess();
|
|
|
| // Three proxies should be available for use: primary, fallback, and direct.
|
| const net::ProxyConfig& proxy_config =
|
| drp_test_context_->configurator()->GetProxyConfig();
|
| EXPECT_EQ(3U, proxy_config.proxy_rules().proxies_for_http.size());
|
| }
|
|
|
| // Creates a URLRequest using the test's TestURLRequestContext and executes
|
| @@ -323,20 +325,21 @@ class DataReductionProxyInterceptorEndToEndTest : public testing::Test {
|
| net::ProxyServer origin() const {
|
| return config()->test_params()->proxies_for_http().front();
|
| }
|
|
|
| private:
|
| base::MessageLoopForIO message_loop_;
|
| net::TestDelegate delegate_;
|
| net::MockClientSocketFactory mock_socket_factory_;
|
| net::TestURLRequestContext context_;
|
| net::URLRequestContextStorage context_storage_;
|
| + scoped_ptr<net::ProxyDelegate> proxy_delegate_;
|
| scoped_ptr<DataReductionProxyTestContext> drp_test_context_;
|
| };
|
|
|
| const std::string kBody = "response body";
|
|
|
| TEST_F(DataReductionProxyInterceptorEndToEndTest, ResponseWithoutRetry) {
|
| // The response comes through the proxy and should not be retried.
|
| MockRead mock_reads[] = {
|
| MockRead("HTTP/1.1 200 OK\r\nVia: 1.1 Chrome-Compression-Proxy\r\n\r\n"),
|
| MockRead(kBody.c_str()),
|
|
|