Index: components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc |
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc |
index ad2433813e76cae58db070b07439d0cd96305745..de7d98312022f2018263c4d96b1a3d081ba77720 100644 |
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc |
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc |
@@ -10,6 +10,10 @@ |
#include "base/prefs/pref_registry_simple.h" |
#include "base/prefs/scoped_user_pref_update.h" |
#include "base/strings/string_number_conversions.h" |
+#include "base/test/test_simple_task_runner.h" |
+#include "base/time/time.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
+#include "components/data_reduction_proxy/browser/data_reduction_proxy_statistics_prefs.h" |
#include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names.h" |
#include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h" |
@@ -75,8 +79,7 @@ void TestDataReductionProxyConfig::Disable() { |
} |
DataReductionProxySettingsTestBase::DataReductionProxySettingsTestBase() |
- : testing::Test() { |
-} |
+ : testing::Test() {} |
DataReductionProxySettingsTestBase::~DataReductionProxySettingsTestBase() {} |
@@ -92,6 +95,13 @@ void DataReductionProxySettingsTestBase::SetUp() { |
registry->RegisterBooleanPref(prefs::kDataReductionProxyAltEnabled, false); |
registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore, |
false); |
+ |
+ statistics_prefs_.reset(new DataReductionProxyStatisticsPrefs( |
+ &pref_service_, |
+ scoped_refptr<base::TestSimpleTaskRunner>( |
+ new base::TestSimpleTaskRunner()), |
+ base::TimeDelta())); |
+ |
//AddProxyToCommandLine(); |
ResetSettings(true, true, false, true, false); |
@@ -105,7 +115,7 @@ void DataReductionProxySettingsTestBase::SetUp() { |
received_update->Insert(0, new base::StringValue(base::Int64ToString(i))); |
} |
last_update_time_ = base::Time::Now().LocalMidnight(); |
- pref_service_.SetInt64( |
+ statistics_prefs_->SetInt64( |
prefs::kDailyHttpContentLengthLastUpdateDate, |
last_update_time_.ToInternalValue()); |
expected_params_.reset(new TestDataReductionProxyParams( |
@@ -147,6 +157,7 @@ void DataReductionProxySettingsTestBase::ResetSettings(bool allowed, |
settings_.reset(settings); |
configurator_.reset(new TestDataReductionProxyConfig()); |
settings_->configurator_ = configurator_.get(); |
+ settings_->SetDataReductionProxyStatisticsPrefs(statistics_prefs_.get()); |
} |
// Explicitly generate required instantiations. |
@@ -284,7 +295,6 @@ void DataReductionProxySettingsTestBase::CheckInitDataReductionProxy( |
settings_->InitDataReductionProxySettings( |
&pref_service_, |
- &pref_service_, |
request_context.get()); |
settings_->SetOnDataReductionEnabledCallback( |
base::Bind(&DataReductionProxySettingsTestBase:: |