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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_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
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc ('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_usage_stats_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc
index aadf49edc88f001913dd07bd12dd7db682592a8e..338bdec6fa6f42a4ea078b0e655b14ada82045ce 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_usage_stats_unittest.cc
@@ -90,15 +90,16 @@ class DataReductionProxyUsageStatsTest : public testing::Test {
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));
+ test_context_ =
+ DataReductionProxyTestContext::Builder()
+ .WithParamsFlags(DataReductionProxyParams::kAllowed |
+ DataReductionProxyParams::kFallbackAllowed |
+ DataReductionProxyParams::kPromoAllowed)
+ .WithParamsDefinitions(
+ TestDataReductionProxyParams::HAS_EVERYTHING &
+ ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
+ ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)
+ .Build();
mock_url_request_ = context_.CreateRequest(GURL(), net::IDLE, &delegate_,
NULL);
scoped_ptr<DataReductionProxyParamsMock> mock_params =
@@ -590,11 +591,13 @@ class DataReductionProxyUsageStatsEndToEndTest : public testing::Test {
// test bypassed bytes due to proxy fallbacks. This way, a test just needs
// to cause one proxy fallback in order for the data reduction proxy to be
// fully bypassed.
- test_context_.reset(new DataReductionProxyTestContext(
- DataReductionProxyParams::kAllowed,
- TestDataReductionProxyParams::HAS_ORIGIN,
- DataReductionProxyTestContext::SKIP_SETTINGS_INITIALIZATION,
- &context_));
+ test_context_ =
+ DataReductionProxyTestContext::Builder()
+ .WithParamsFlags(DataReductionProxyParams::kAllowed)
+ .WithParamsDefinitions(TestDataReductionProxyParams::HAS_ORIGIN)
+ .WithURLRequestContext(&context_)
+ .SkipSettingsInitialization()
+ .Build();
test_context_->pref_service()->SetBoolean(prefs::kDataReductionProxyEnabled,
true);
test_context_->InitSettings();
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698