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()); |