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

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

Issue 2439303002: Record UMA on number of days since data reduction proxy is enabled. (Closed)
Patch Set: fix compile error Created 4 years, 2 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_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 245d75c16c7d1102075227bcc235d04f73a9ca85..9b5fe4bdf378fe9ea5795fa8ab2e4fc1195f43a7 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
@@ -10,7 +10,6 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
-#include "base/time/time.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
@@ -55,8 +54,7 @@ void DataReductionProxySettingsTestBase::SetUp() {
pref_service->registry()->RegisterDictionaryPref(kProxy);
pref_service->SetBoolean(prefs::kDataReductionProxyWasEnabledBefore, false);
- //AddProxyToCommandLine();
- ResetSettings(true, true, true, false);
+ ResetSettings(nullptr, true, true, true, false);
ListPrefUpdate original_update(test_context_->pref_service(),
prefs::kDailyHttpOriginalContentLength);
@@ -74,10 +72,12 @@ void DataReductionProxySettingsTestBase::SetUp() {
}
template <class C>
-void DataReductionProxySettingsTestBase::ResetSettings(bool allowed,
- bool fallback_allowed,
- bool promo_allowed,
- bool holdback) {
+void DataReductionProxySettingsTestBase::ResetSettings(
+ std::unique_ptr<base::Clock> clock,
+ bool allowed,
+ bool fallback_allowed,
+ bool promo_allowed,
+ bool holdback) {
int flags = 0;
if (allowed)
flags |= DataReductionProxyParams::kAllowed;
@@ -93,6 +93,8 @@ void DataReductionProxySettingsTestBase::ResetSettings(bool allowed,
settings->prefs_ = test_context_->pref_service();
settings->data_reduction_proxy_service_ =
test_context_->CreateDataReductionProxyService(settings);
+ if (clock)
+ settings->clock_ = std::move(clock);
test_context_->config()->ResetParamFlagsForTest(flags);
settings->UpdateConfigValues();
EXPECT_CALL(*settings, GetOriginalProfilePrefs())
@@ -105,12 +107,12 @@ void DataReductionProxySettingsTestBase::ResetSettings(bool allowed,
}
// Explicitly generate required instantiations.
-template void
-DataReductionProxySettingsTestBase::ResetSettings<DataReductionProxySettings>(
- bool allowed,
- bool fallback_allowed,
- bool promo_allowed,
- bool holdback);
+template void DataReductionProxySettingsTestBase::ResetSettings<
+ DataReductionProxySettings>(std::unique_ptr<base::Clock> clock,
+ bool allowed,
+ bool fallback_allowed,
+ bool promo_allowed,
+ bool holdback);
void DataReductionProxySettingsTestBase::ExpectSetProxyPrefs(
bool expected_enabled,

Powered by Google App Engine
This is Rietveld 408576698