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

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

Issue 1989243003: Add DRP client config tests for secure proxy check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 6f90a4d817cb43c4b6afe761f81ed9f24ecfcb71..e150ff96e9e3f05f86e14befe4c87332fb9862c8 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
@@ -169,18 +169,33 @@ TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) {
ResetSettings(true, true, true, false);
std::vector<net::ProxyServer> expected_http_proxies;
- config()->UpdateConfigurator(true, false);
+ config()->UpdateConfigurator(true /* enabled */,
+ true /* secure_proxy_allowed */);
EXPECT_TRUE(configurator()->enabled());
expected_http_proxies.push_back(net::ProxyServer::FromURI(
params()->DefaultOrigin(), net::ProxyServer::SCHEME_HTTP));
expected_http_proxies.push_back(net::ProxyServer::FromURI(
params()->DefaultFallbackOrigin(), net::ProxyServer::SCHEME_HTTP));
+ expected_http_proxies.push_back(net::ProxyServer::Direct());
EXPECT_THAT(configurator()->proxies_for_http(),
testing::ContainerEq(expected_http_proxies));
- config()->UpdateConfigurator(false, false);
+ config()->UpdateConfigurator(false /* enabled */,
+ false /* secure_proxy_allowed */);
EXPECT_FALSE(configurator()->enabled());
EXPECT_TRUE(configurator()->proxies_for_http().empty());
+
+ config()->UpdateConfigurator(true /* enabled */,
+ false /* secure_proxy_allowed */);
+ EXPECT_TRUE(configurator()->enabled());
+ expected_http_proxies.clear();
+ expected_http_proxies.push_back(net::ProxyServer::FromURI(
+ params()->DefaultOrigin(), net::ProxyServer::SCHEME_HTTP));
+ expected_http_proxies.push_back(net::ProxyServer::FromURI(
+ params()->DefaultFallbackOrigin(), net::ProxyServer::SCHEME_HTTP));
+ expected_http_proxies.push_back(net::ProxyServer::Direct());
+ EXPECT_THAT(configurator()->proxies_for_http(),
+ testing::ContainerEq(expected_http_proxies));
}
TEST_F(DataReductionProxyConfigTest, TestUpdateConfiguratorHoldback) {

Powered by Google App Engine
This is Rietveld 408576698