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

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

Issue 1871783002: Remove the Data Reduction Proxy TLS experiment code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tbansal comments Created 4 years, 8 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_config_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
index 3146f03eb5746570e0a9002570f107d8712a866f..efee9eb5a9a098369c57851a53b8ec156845878d 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
@@ -61,8 +61,7 @@ class DataReductionProxyConfigTest : public testing::Test {
DataReductionProxyParams::kAllowed |
DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed,
- TestDataReductionProxyParams::HAS_EVERYTHING &
- ~TestDataReductionProxyParams::HAS_SSL_ORIGIN));
+ TestDataReductionProxyParams::HAS_EVERYTHING));
}
void ResetSettings(bool allowed,
@@ -160,7 +159,6 @@ TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) {
ResetSettings(true, true, true, false);
std::vector<net::ProxyServer> expected_http_proxies;
- std::vector<net::ProxyServer> expected_https_proxies;
config()->UpdateConfigurator(true, false);
EXPECT_TRUE(configurator()->enabled());
expected_http_proxies.push_back(net::ProxyServer::FromURI(
@@ -169,13 +167,10 @@ TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) {
params()->DefaultFallbackOrigin(), net::ProxyServer::SCHEME_HTTP));
EXPECT_THAT(configurator()->proxies_for_http(),
testing::ContainerEq(expected_http_proxies));
- EXPECT_THAT(configurator()->proxies_for_https(),
- testing::ContainerEq(expected_https_proxies));
config()->UpdateConfigurator(false, false);
EXPECT_FALSE(configurator()->enabled());
EXPECT_TRUE(configurator()->proxies_for_http().empty());
- EXPECT_TRUE(configurator()->proxies_for_https().empty());
}
TEST_F(DataReductionProxyConfigTest, TestUpdateConfiguratorHoldback) {
@@ -184,7 +179,6 @@ TEST_F(DataReductionProxyConfigTest, TestUpdateConfiguratorHoldback) {
config()->UpdateConfigurator(true, false);
EXPECT_FALSE(configurator()->enabled());
EXPECT_TRUE(configurator()->proxies_for_http().empty());
- EXPECT_TRUE(configurator()->proxies_for_https().empty());
}
TEST_F(DataReductionProxyConfigTest, TestOnIPAddressChanged) {
@@ -251,191 +245,128 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassed) {
// proxies in retry map
bool origin;
bool fallback_origin;
- bool ssl_origin;
bool expected_result;
} tests[] = {
{
- // proxy flags
- false,
- false,
- // is https request
- false,
- // proxies in retry map
- false,
- false,
- false,
- // expected result
- false,
- },
- {
- // proxy flags
- false,
- false,
- // is https request
- true,
- // proxies in retry map
- false,
- false,
- true,
- // expected result
- true,
- },
- {
- // proxy flags
- false,
- true,
- // is https request
- false,
- // proxies in retry map
- false,
- false,
- false,
- // expected result
- false,
+ // proxy flags
+ false, false,
+ // is https request
+ false,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- false,
- // is https request
- false,
- // proxies in retry map
- false,
- false,
- false,
- // expected result
- false,
+ // proxy flags
+ false, false,
+ // is https request
+ true,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- false,
- // is https request
- false,
- // proxies in retry map
- true,
- false,
- false,
- // expected result
- true,
+ // proxy flags
+ false, true,
+ // is https request
+ false,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- false,
- // proxies in retry map
- false,
- false,
- false,
- // expected result
- false,
+ // proxy flags
+ true, false,
+ // is https request
+ false,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- false,
- // proxies in retry map
- true,
- false,
- false,
- // expected result
- false,
+ // proxy flags
+ true, false,
+ // is https request
+ false,
+ // proxies in retry map
+ true, false,
+ // expected result
+ true,
},
{
- // proxy flags
- true,
- true,
- // is https request
- false,
- // proxies in retry map
- true,
- true,
- false,
- // expected result
- true,
+ // proxy flags
+ true, true,
+ // is https request
+ false,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- false,
- // proxies in retry map
- true,
- true,
- true,
- // expected result
- true,
+ // proxy flags
+ true, true,
+ // is https request
+ false,
+ // proxies in retry map
+ true, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- true,
- // proxies in retry map
- false,
- false,
- false,
- // expected result
- false,
+ // proxy flags
+ true, true,
+ // is https request
+ false,
+ // proxies in retry map
+ true, true,
+ // expected result
+ true,
},
{
- // proxy flags
- true,
- true,
- // is https request
- true,
- // proxies in retry map
- false,
- false,
- true,
- // expected result
- true,
+ // proxy flags
+ true, true,
+ // is https request
+ true,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- false,
- // proxies in retry map
- false,
- true,
- false,
- // expected result
- false,
+ // proxy flags
+ true, true,
+ // is https request
+ true,
+ // proxies in retry map
+ false, false,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- true,
- // proxies in retry map
- true,
- true,
- true,
- // expected result
- true,
+ // proxy flags
+ true, true,
+ // is https request
+ false,
+ // proxies in retry map
+ false, true,
+ // expected result
+ false,
},
{
- // proxy flags
- true,
- true,
- // is https request
- true,
- // proxies in retry map
- true,
- true,
- false,
- // expected result
- false,
+ // proxy flags
+ true, true,
+ // is https request
+ true,
+ // proxies in retry map
+ true, true,
+ // expected result
+ false,
},
};
@@ -444,8 +375,6 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassed) {
TestDataReductionProxyParams::DefaultOrigin());
std::string fallback_origin = GetRetryMapKeyFromOrigin(
TestDataReductionProxyParams::DefaultFallbackOrigin());
- std::string ssl_origin = GetRetryMapKeyFromOrigin(
- TestDataReductionProxyParams::DefaultSSLOrigin());
for (size_t i = 0; i < arraysize(tests); ++i) {
net::ProxyConfig::ProxyRules rules;
@@ -457,7 +386,6 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassed) {
proxies.push_back(fallback_origin);
std::string proxy_rules = "http=" + base::JoinString(proxies, ",") +
- ",direct://;" + "https=" + ssl_origin +
",direct://;";
rules.ParseFromString(proxy_rules);
@@ -481,8 +409,6 @@ TEST_F(DataReductionProxyConfigTest, AreProxiesBypassed) {
retry_map[origin] = retry_info;
if (tests[i].fallback_origin)
retry_map[fallback_origin] = retry_info;
- if (tests[i].ssl_origin)
- retry_map[ssl_origin] = retry_info;
bool was_bypassed = config->AreProxiesBypassed(retry_map,
rules,
@@ -561,63 +487,42 @@ TEST_F(DataReductionProxyConfigTest, IsDataReductionProxyWithParams) {
net::HostPortPair expected_first;
net::HostPortPair expected_second;
bool expected_is_fallback;
- bool expected_is_ssl;
} tests[] = {
{net::ProxyServer::FromURI(TestDataReductionProxyParams::DefaultOrigin(),
net::ProxyServer::SCHEME_HTTP)
.host_port_pair(),
- true,
- true,
+ true, true,
net::ProxyServer::FromURI(TestDataReductionProxyParams::DefaultOrigin(),
net::ProxyServer::SCHEME_HTTP)
.host_port_pair(),
net::ProxyServer::FromURI(
TestDataReductionProxyParams::DefaultFallbackOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- false,
+ net::ProxyServer::SCHEME_HTTP)
+ .host_port_pair(),
false},
{net::ProxyServer::FromURI(TestDataReductionProxyParams::DefaultOrigin(),
net::ProxyServer::SCHEME_HTTP)
.host_port_pair(),
- false,
- true,
+ false, true,
net::ProxyServer::FromURI(TestDataReductionProxyParams::DefaultOrigin(),
net::ProxyServer::SCHEME_HTTP)
.host_port_pair(),
- net::HostPortPair::FromURL(GURL()),
- false,
- false},
+ net::HostPortPair::FromURL(GURL()), false},
{net::ProxyServer::FromURI(
TestDataReductionProxyParams::DefaultFallbackOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- true,
- true,
- net::ProxyServer::FromURI(
- TestDataReductionProxyParams::DefaultFallbackOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- net::HostPortPair::FromURL(GURL()),
- true,
- false},
+ net::ProxyServer::SCHEME_HTTP)
+ .host_port_pair(),
+ true, true, net::ProxyServer::FromURI(
+ TestDataReductionProxyParams::DefaultFallbackOrigin(),
+ net::ProxyServer::SCHEME_HTTP)
+ .host_port_pair(),
+ net::HostPortPair::FromURL(GURL()), true},
{net::ProxyServer::FromURI(
TestDataReductionProxyParams::DefaultFallbackOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- false,
- false,
- net::HostPortPair::FromURL(GURL()),
- net::HostPortPair::FromURL(GURL()),
- false,
- false},
- {net::ProxyServer::FromURI(
- TestDataReductionProxyParams::DefaultSSLOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- true,
- true,
- net::ProxyServer::FromURI(
- TestDataReductionProxyParams::DefaultSSLOrigin(),
- net::ProxyServer::SCHEME_HTTP).host_port_pair(),
- net::HostPortPair::FromURL(GURL()),
- false,
- true},
+ net::ProxyServer::SCHEME_HTTP)
+ .host_port_pair(),
+ false, false, net::HostPortPair::FromURL(GURL()),
+ net::HostPortPair::FromURL(GURL()), false},
};
for (size_t i = 0; i < arraysize(tests); ++i) {
int flags = DataReductionProxyParams::kAllowed;
@@ -659,7 +564,6 @@ TEST_F(DataReductionProxyConfigTest, IsDataReductionProxyWithParams) {
}
EXPECT_EQ(tests[i].expected_is_fallback, proxy_type_info.is_fallback) << i;
- EXPECT_EQ(tests[i].expected_is_ssl, proxy_type_info.is_ssl) << i;
}
}
@@ -741,7 +645,6 @@ TEST_F(DataReductionProxyConfigTest, IsDataReductionProxyWithMutableConfig) {
EXPECT_THAT(proxy_type_info.proxy_servers,
testing::ContainerEq(expected_proxy_servers))
<< i;
- EXPECT_FALSE(proxy_type_info.is_ssl) << i;
}
}

Powered by Google App Engine
This is Rietveld 408576698