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

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

Issue 388663002: Added data reduction proxy holdback experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
« no previous file with comments | « components/data_reduction_proxy/browser/data_reduction_proxy_settings_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/browser/data_reduction_proxy_settings_unittest.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
index a8ac9f0d4f0e0568cae22c5cec3ec7a3a2461be5..27c68a6389cab38878e7cab5b1a5c07805a849c8 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
@@ -44,7 +44,7 @@ TEST_F(DataReductionProxySettingsTest, TestGetDataReductionProxyOrigin) {
TEST_F(DataReductionProxySettingsTest, TestGetDataReductionProxyDevOrigin) {
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kDataReductionProxyDev, expected_params_->DefaultDevOrigin());
- ResetSettings(true, true, false, true);
+ ResetSettings(true, true, false, true, false);
std::string result =
settings_->params()->origin().spec();
EXPECT_EQ(GURL(expected_params_->DefaultDevOrigin()), GURL(result));
@@ -83,7 +83,7 @@ TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) {
drp_params.DefaultAltFallbackOrigin());
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kDataReductionSSLProxy, drp_params.DefaultSSLOrigin());
- ResetSettings(true, true, true, true);
+ ResetSettings(true, true, true, true, false);
TestDataReductionProxyConfig* config =
static_cast<TestDataReductionProxyConfig*>(
settings_->configurator());
@@ -122,6 +122,20 @@ TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) {
EXPECT_EQ("", config->ssl_origin_);
}
+TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigsHoldback) {
+ ResetSettings(true, true, true, true, true);
+ TestDataReductionProxyConfig* config =
+ static_cast<TestDataReductionProxyConfig*>(
+ settings_->configurator());
+
+ // Holdback.
+ settings_->SetProxyConfigs(true, true, false, false);
+ EXPECT_FALSE(config->enabled_);
+ EXPECT_EQ("", config->origin_);
+ EXPECT_EQ("", config->fallback_origin_);
+ EXPECT_EQ("", config->ssl_origin_);
+}
+
TEST_F(DataReductionProxySettingsTest, TestIsProxyEnabledOrManaged) {
settings_->InitPrefMembers();
base::MessageLoopForUI loop;
@@ -396,7 +410,7 @@ TEST_F(DataReductionProxySettingsTest, CheckInitMetricsWhenNotAllowed) {
// Clear the command line. Setting flags can force the proxy to be allowed.
CommandLine::ForCurrentProcess()->InitFromArgv(0, NULL);
- ResetSettings(false, false, false, false);
+ ResetSettings(false, false, false, false, false);
MockSettings* settings = static_cast<MockSettings*>(settings_.get());
EXPECT_FALSE(settings->params()->allowed());
EXPECT_CALL(*settings, RecordStartupState(PROXY_NOT_AVAILABLE));
« no previous file with comments | « components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698