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

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: 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_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 28548827409f0d54e7503500d8d601accf29ebea..88f4567d681ebb9906b8655ed47ccb7120bd1f2b 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,21 @@ 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.
+ ResetSettings(true, true, true, true, true);
+ settings_->SetProxyConfigs(true, true, false, false);
+ EXPECT_TRUE(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;
@@ -365,7 +380,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));

Powered by Google App Engine
This is Rietveld 408576698