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

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

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: Moving set callback out of init Created 6 years, 5 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/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 ec976628a9a1501227923d2a493d2eb31a2ca194..ccd3c2dd2b4211d804a2e2053456120998a8b854 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
@@ -4,6 +4,7 @@
#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_registry_simple.h"
@@ -299,12 +300,19 @@ void DataReductionProxySettingsTestBase::CheckInitDataReductionProxy(
settings_->SetProxyConfigurator(configurator.Pass());
scoped_refptr<net::TestURLRequestContextGetter> request_context =
new net::TestURLRequestContextGetter(base::MessageLoopProxy::current());
- settings_->InitDataReductionProxySettings(&pref_service_,
- &pref_service_,
- request_context.get());
+
+ settings_->InitDataReductionProxySettings(
+ &pref_service_,
+ &pref_service_,
+ request_context.get());
+ settings_->SetOnDataReductionEnabledCallback(
+ base::Bind(&DataReductionProxySettingsTestBase::
+ RegisterSyntheticFieldTrialCallback,
+ base::Unretained(this)));
base::MessageLoop::current()->RunUntilIdle();
CheckProxyConfigs(enabled_at_startup, false, false);
+ EXPECT_EQ(enabled_at_startup, proxy_enabled_);
}
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698