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

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

Issue 959913002: Create fluent Builder for DataReductionProxyTestContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sclittle CR comments + 1 unittest cleanup 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_network_delegate_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
index 8f43dae0bce6e99b7fc0dc545c966e47bebcbe93..3e91abfa8a610416a7cfa12b8fcf79b1b34a59d3 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -77,24 +77,24 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test {
test_job_interceptor_));
context_.set_job_factory(&test_job_factory_);
- test_context_.reset(
- new DataReductionProxyTestContext(
- DataReductionProxyParams::kAllowed |
- DataReductionProxyParams::kFallbackAllowed |
- DataReductionProxyParams::kPromoAllowed,
- TestDataReductionProxyParams::HAS_EVERYTHING &
- ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
- ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
- DataReductionProxyTestContext::DEFAULT_TEST_CONTEXT_OPTIONS,
- &context_));
-
- request_options_.reset(
- new DataReductionProxyRequestOptions(
- kClient, config(), test_context_->task_runner()));
+ test_context_ =
+ DataReductionProxyTestContext::Builder()
+ .WithParamsFlags(DataReductionProxyParams::kAllowed |
+ DataReductionProxyParams::kFallbackAllowed |
+ DataReductionProxyParams::kPromoAllowed)
+ .WithParamsDefinitions(
+ TestDataReductionProxyParams::HAS_EVERYTHING &
+ ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
+ ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)\
+ .WithClient(kClient)
+ .WithURLRequestContext(&context_)
+ .Build();
+
data_reduction_proxy_network_delegate_.reset(
new DataReductionProxyNetworkDelegate(
scoped_ptr<net::NetworkDelegate>(new TestNetworkDelegate()),
- config(), request_options_.get(), test_context_->configurator()));
+ config(), test_context_->io_data()->request_options(),
+ test_context_->configurator()));
}
const net::ProxyConfig& GetProxyConfig() const {
@@ -155,7 +155,6 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test {
return test_context_->data_reduction_proxy_service()->statistics_prefs();
}
- scoped_ptr<DataReductionProxyRequestOptions> request_options_;
scoped_ptr<DataReductionProxyNetworkDelegate>
data_reduction_proxy_network_delegate_;

Powered by Google App Engine
This is Rietveld 408576698