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

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

Issue 1123173004: Do not disable Data Reduction Proxy on VPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 5 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 f6f522c1b7c1e2cc2e21014fc691cc11507761c6..103f0a317af1f8ec115c595def4004365df9d504 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
@@ -143,6 +143,26 @@ class DataReductionProxyConfigTest : public testing::Test {
scoped_ptr<TestDataReductionProxyParams> expected_params_;
};
+TEST_F(DataReductionProxyConfigTest, TestMaybeDisableIfVPNTrialDisabled) {
+ // Simulate a VPN connection.
+ config()->interfaces()->clear();
+ config()->interfaces()->push_back(net::NetworkInterface(
+ "tun0", /* network interface name */
+ "tun0", /* network interface friendly name */
+ 0, /* interface index */
+ net::NetworkChangeNotifier::CONNECTION_WIFI, net::IPAddressNumber(),
+ 0, /* network prefix */
+ net::IP_ADDRESS_ATTRIBUTE_NONE /* ip address attribute */
+ ));
+ EXPECT_TRUE(config()->MaybeDisableIfVPN());
+}
+
+TEST_F(DataReductionProxyConfigTest, TestMaybeDisableIfVPNTrialEnabled) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ "force-fieldtrials", "DataReductionProxyUseDataSaverOnVPN/Enabled");
+ EXPECT_FALSE(config()->MaybeDisableIfVPN());
+}
+
TEST_F(DataReductionProxyConfigTest, TestUpdateConfigurator) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kDataReductionProxyAlt, params()->DefaultAltOrigin());

Powered by Google App Engine
This is Rietveld 408576698