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

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

Issue 2571993002: Cleanup DataReductionProxy (DRP) Brotli code (Closed)
Patch Set: ps Created 4 years 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
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
index bb39ab64fe7fe810ab6fb6ebcd771688faef0c7c..f31ebd95a095cdf9b03049b1beb32b987c9640be 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc
@@ -218,13 +218,14 @@ TestDataReductionProxyIOData::TestDataReductionProxyIOData(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
std::unique_ptr<DataReductionProxyConfig> config,
std::unique_ptr<DataReductionProxyEventCreator> event_creator,
- std::unique_ptr<DataReductionProxyRequestOptions> request_options,
+ std::unique_ptr<TestDataReductionProxyRequestOptions> request_options,
std::unique_ptr<DataReductionProxyConfigurator> configurator,
net::NetLog* net_log,
bool enabled)
: DataReductionProxyIOData(),
service_set_(false),
- pingback_reporting_fraction_(0.0f) {
+ pingback_reporting_fraction_(0.0f),
+ test_request_options_(request_options.get()) {
io_task_runner_ = task_runner;
ui_task_runner_ = task_runner;
config_ = std::move(config);
@@ -443,14 +444,15 @@ DataReductionProxyTestContext::Builder::Build() {
event_creator.get()));
}
- std::unique_ptr<DataReductionProxyRequestOptions> request_options;
+ std::unique_ptr<TestDataReductionProxyRequestOptions> request_options;
+
if (use_mock_request_options_) {
test_context_flags |= USE_MOCK_REQUEST_OPTIONS;
request_options.reset(
new MockDataReductionProxyRequestOptions(client_, config.get()));
} else {
- request_options.reset(
- new DataReductionProxyRequestOptions(client_, config.get()));
+ request_options.reset(new TestDataReductionProxyRequestOptions(
+ client_, "1.2.3.4", config.get()));
}
std::unique_ptr<DataReductionProxySettings> settings(
@@ -613,8 +615,7 @@ DataReductionProxyTestContext::CreateDataReductionProxyServiceInternal(
}
void DataReductionProxyTestContext::AttachToURLRequestContext(
- net::URLRequestContextStorage* request_context_storage,
- bool exclude_chrome_proxy_header_for_testing) const {
+ net::URLRequestContextStorage* request_context_storage) const {
DCHECK(request_context_storage);
// |request_context_storage| takes ownership of the network delegate.
@@ -622,8 +623,6 @@ void DataReductionProxyTestContext::AttachToURLRequestContext(
io_data()->CreateNetworkDelegate(
base::MakeUnique<net::TestNetworkDelegate>(), true);
- network_delegate->exclude_chrome_proxy_header_for_testing_ =
- exclude_chrome_proxy_header_for_testing;
request_context_storage->set_network_delegate(std::move(network_delegate));
request_context_storage->set_job_factory(
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698