Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc |
| index 053b0bcde26d9b861fc3f4e7fd025b37dc17c6ab..26a8171fcfb51de14998f6f1519a7ecdd8d3219f 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_test_utils.cc |
| @@ -68,11 +68,6 @@ void DataReductionProxySettingsTestBase::SetUp() { |
| registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore, |
| false); |
| - statistics_prefs_.reset(new DataReductionProxyStatisticsPrefs( |
| - &pref_service_, |
| - scoped_refptr<base::TestSimpleTaskRunner>( |
| - new base::TestSimpleTaskRunner()), |
| - base::TimeDelta())); |
| event_store_.reset(new DataReductionProxyEventStore( |
| scoped_refptr<base::TestSimpleTaskRunner>( |
| new base::TestSimpleTaskRunner()))); |
| @@ -90,9 +85,17 @@ void DataReductionProxySettingsTestBase::SetUp() { |
| received_update->Insert(0, new base::StringValue(base::Int64ToString(i))); |
| } |
| last_update_time_ = base::Time::Now().LocalMidnight(); |
| - statistics_prefs_->SetInt64( |
| + scoped_ptr<DataReductionProxyStatisticsPrefs> statistics_prefs( |
| + new DataReductionProxyStatisticsPrefs( |
| + &pref_service_, |
|
bengr
2015/02/04 23:39:11
#include drp_statistics_prefs.h
megjablon
2015/02/06 23:40:42
Already included.
bengr
2015/02/06 23:56:14
Ah. Missed that.
|
| + scoped_refptr<base::TestSimpleTaskRunner>( |
| + new base::TestSimpleTaskRunner()), |
| + base::TimeDelta())); |
| + statistics_prefs->SetInt64( |
| prefs::kDailyHttpContentLengthLastUpdateDate, |
| last_update_time_.ToInternalValue()); |
| + settings_->SetDataReductionProxyStatisticsPrefs( |
|
bengr
2015/02/04 23:39:11
Is this needed because Init is not called in every
megjablon
2015/02/06 23:40:42
Ya, Init is not called for a lot of tests. Changin
bengr
2015/02/06 23:56:14
Yes. Please file a bug.
|
| + statistics_prefs.Pass()); |
| expected_params_.reset(new TestDataReductionProxyParams( |
| DataReductionProxyParams::kAllowed | |
| DataReductionProxyParams::kFallbackAllowed | |
| @@ -134,7 +137,6 @@ void DataReductionProxySettingsTestBase::ResetSettings(bool allowed, |
| scoped_refptr<base::TestSimpleTaskRunner>( |
| new base::TestSimpleTaskRunner()), &net_log_, event_store_.get())); |
| settings_->configurator_ = configurator_.get(); |
| - settings_->SetDataReductionProxyStatisticsPrefs(statistics_prefs_.get()); |
| } |
| // Explicitly generate required instantiations. |
| @@ -271,6 +273,7 @@ void DataReductionProxySettingsTestBase::CheckInitDataReductionProxy( |
| settings_->InitDataReductionProxySettings( |
| &pref_service_, |
| + scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs>(), |
| request_context.get(), |
| &net_log_, |
| event_store_.get()); |