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

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

Issue 893003002: Data Reduction Proxy class ownership updates and Settings cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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_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 406ece1ea47d03346dc481365979839f136fb6a0..cb5a139a7ec2773594a9d86be1c5ed863b56f086 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
@@ -13,13 +13,17 @@
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.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_interceptor.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers_test_utils.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
+#include "net/base/capturing_net_log.h"
#include "net/base/completion_callback.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
@@ -80,8 +84,7 @@ class BadEntropyProvider : public base::FieldTrial::EntropyProvider {
class DataReductionProxyProtocolTest : public testing::Test {
public:
DataReductionProxyProtocolTest() : http_user_agent_settings_("", "") {
- settings_.reset(
- new DataReductionProxySettings(CreateDataReductionProxyParams()));
+ settings_.reset(new DataReductionProxySettings());
proxy_params_.reset(CreateDataReductionProxyParams().release());
simple_interceptor_.reset(new SimpleURLRequestInterceptor());
net::URLRequestFilter::GetInstance()->AddHostnameInterceptor(
@@ -126,15 +129,19 @@ class DataReductionProxyProtocolTest : public testing::Test {
// This is needed to prevent the test context from adding language headers
// to requests.
context_->set_http_user_agent_settings(&http_user_agent_settings_);
- usage_stats_.reset(new DataReductionProxyUsageStats(
- settings_->params(), settings_.get(),
- base::MessageLoopProxy::current()));
+ test_context_.reset(new DataReductionProxyTestContext(false));
+ test_context_->config()->ResetParamsForTest(
+ CreateDataReductionProxyParams());
+ settings_->ResetConfigForTest(test_context_->config());
- event_store_.reset(
- new DataReductionProxyEventStore(base::MessageLoopProxy::current()));
+ usage_stats_.reset(new DataReductionProxyUsageStats(
+ test_context_->config()->params(), settings_.get(),
+ base::MessageLoopProxy::current()));
DataReductionProxyInterceptor* interceptor =
- new DataReductionProxyInterceptor(
- settings_->params(), usage_stats_.get(), event_store_.get());
+ new DataReductionProxyInterceptor(test_context_->config()->params(),
+ usage_stats_.get(),
+ test_context_->event_store());
+
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory_impl(
new net::URLRequestJobFactoryImpl());
job_factory_.reset(new net::URLRequestInterceptingJobFactory(
@@ -341,8 +348,8 @@ class DataReductionProxyProtocolTest : public testing::Test {
scoped_ptr<ProxyService> proxy_service_;
scoped_ptr<TestDataReductionProxyParams> proxy_params_;
scoped_ptr<DataReductionProxySettings> settings_;
+ scoped_ptr<DataReductionProxyTestContext> test_context_;
scoped_ptr<DataReductionProxyUsageStats> usage_stats_;
- scoped_ptr<DataReductionProxyEventStore> event_store_;
net::StaticHttpUserAgentSettings http_user_agent_settings_;
scoped_ptr<net::URLRequestInterceptingJobFactory> job_factory_;

Powered by Google App Engine
This is Rietveld 408576698