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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc

Issue 669163003: Handle disabling data reduction proxy for all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed bengr's comments Created 6 years, 2 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: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc
index 06848fa2102af08b986dfc3abe8001758ae6b0d9..ef64fc555291a795603ecf05cd45bc31a4845fd4 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator_unittest.cc
@@ -8,10 +8,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_registry_simple.h"
+#include "base/prefs/scoped_user_pref_update.h"
#include "base/prefs/testing_pref_service.h"
#include "base/test/test_simple_task_runner.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_params.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -116,6 +118,10 @@ TEST_F(DataReductionProxyConfigTest, TestFallbackRestricted) {
}
TEST_F(DataReductionProxyConfigTest, TestBothRestricted) {
+ DictionaryPrefUpdate update(&pref_service_, prefs::kProxy);
+ base::DictionaryValue* dict = update.Get();
+ dict->SetString("mode", "system");
+
config_->Enable(true,
true,
"https://www.foo.com:443/",
@@ -125,10 +131,34 @@ TEST_F(DataReductionProxyConfigTest, TestBothRestricted) {
}
TEST_F(DataReductionProxyConfigTest, TestDisable) {
+ data_reduction_proxy::DataReductionProxyParams params(0);
+ config_->Enable(false,
+ false,
+ params.origin().spec(),
+ params.fallback_origin().spec(),
+ "");
config_->Disable();
CheckProxyConfig("system", "", "");
}
+TEST_F(DataReductionProxyConfigTest, TestDeleteWithUserOverride) {
+ data_reduction_proxy::DataReductionProxyParams params(0);
+ config_->Enable(false,
+ false,
+ params.origin().spec(),
+ params.fallback_origin().spec(),
+ "");
+
+ // Override the data reduction proxy.
+ DictionaryPrefUpdate update(&pref_service_, prefs::kProxy);
+ base::DictionaryValue* dict = update.Get();
+ dict->SetString("server", "https://www.baz.com:22/");
+
+ // This should have no effect since proxy server was overridden.
+ config_->Disable();
+
+ CheckProxyConfig("fixed_servers", "https://www.baz.com:22/", "");
+}
TEST_F(DataReductionProxyConfigTest, TestBypassList) {
config_->AddHostPatternToBypass("http://www.google.com");

Powered by Google App Engine
This is Rietveld 408576698