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

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

Issue 944533002: Context menu item to view original image when Data Saver is being used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 5 years, 10 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_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;

Powered by Google App Engine
This is Rietveld 408576698