Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc |
index 3a66090016dd15509de799f19eca5caa6b38868c..d82f54d50f8349c2520a1102439ce5757f9616de 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc |
@@ -87,15 +87,17 @@ net::ProxyServer GetProxyWithScheme(net::ProxyServer::Scheme scheme) { |
class DataReductionProxyBypassStatsTest : public testing::Test { |
public: |
- DataReductionProxyBypassStatsTest() : context_(true) { |
+ DataReductionProxyBypassStatsTest() |
+ : context_(true), test_job_factory_(nullptr) { |
context_.Init(); |
// The |test_job_factory_| takes ownership of the interceptor. |
test_job_interceptor_ = new net::TestJobInterceptor(); |
- EXPECT_TRUE(test_job_factory_.SetProtocolHandler( |
- url::kHttpScheme, base::WrapUnique(test_job_interceptor_))); |
+ test_job_factory_.reset(new net::URLRequestInterceptingJobFactory( |
+ net::URLRequestJobFactoryImpl::CreateWithHttpProtocolHandlers(), |
+ base::WrapUnique(test_job_interceptor_))); |
- context_.set_job_factory(&test_job_factory_); |
+ context_.set_job_factory(test_job_factory_.get()); |
test_context_ = |
DataReductionProxyTestContext::Builder().WithMockConfig().Build(); |
@@ -152,7 +154,7 @@ class DataReductionProxyBypassStatsTest : public testing::Test { |
std::unique_ptr<net::URLRequest> mock_url_request_; |
// |test_job_interceptor_| is owned by |test_job_factory_|. |
net::TestJobInterceptor* test_job_interceptor_; |
- net::URLRequestJobFactoryImpl test_job_factory_; |
+ std::unique_ptr<net::URLRequestJobFactory> test_job_factory_; |
std::unique_ptr<DataReductionProxyTestContext> test_context_; |
}; |