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

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: Add "&" to new strings. 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 b588554ae0d08098af5c1295f6fead5a2c21e8c0..3b32e372c41c6ef407f6c3f6f4629f4f595d3918 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
@@ -164,6 +164,24 @@ TEST_F(DataReductionProxySettingsTest, TestIsProxyEnabledOrManaged) {
base::MessageLoop::current()->RunUntilIdle();
}
+TEST_F(DataReductionProxySettingsTest, TestCanUseDataReductionProxy) {
+ settings_->InitPrefMembers();
+ base::MessageLoopForUI loop;
+ // The proxy is disabled initially.
+ settings_->enabled_by_user_ = false;
+ settings_->SetProxyConfigs(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));
+
+ base::MessageLoop::current()->RunUntilIdle();
+}
+
TEST_F(DataReductionProxySettingsTest, TestResetDataReductionStatistics) {
int64 original_content_length;
int64 received_content_length;

Powered by Google App Engine
This is Rietveld 408576698