Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc |
index 93fec5885b26f87954f5f6a2a3afa3fa7ce94206..ea0f49c4383aa53156b2cb9eec33b9b2e77f666a 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings_unittest.cc |
@@ -71,6 +71,23 @@ TEST_F(DataReductionProxySettingsTest, TestIsProxyEnabledOrManaged) { |
test_context_->RunUntilIdle(); |
} |
+TEST_F(DataReductionProxySettingsTest, TestCanUseDataReductionProxy) { |
+ settings_->InitPrefMembers(); |
+ // The proxy is disabled initially. |
+ test_context_->config()->SetStateForTest(false, false, false, false); |
+ |
+ GURL http_gurl("http://url.com/"); |
+ EXPECT_FALSE(settings_->CanUseDataReductionProxy(http_gurl)); |
+ |
+ CheckOnPrefChange(true, true, false); |
+ EXPECT_TRUE(settings_->CanUseDataReductionProxy(http_gurl)); |
+ |
+ GURL https_gurl("https://url.com/"); |
+ EXPECT_FALSE(settings_->CanUseDataReductionProxy(https_gurl)); |
+ |
+ test_context_->RunUntilIdle(); |
+} |
+ |
TEST_F(DataReductionProxySettingsTest, TestResetDataReductionStatistics) { |
int64 original_content_length; |
int64 received_content_length; |