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

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

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: rebase (needs fixing) Created 4 years, 2 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_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_;
};

Powered by Google App Engine
This is Rietveld 408576698