summaryrefslogtreecommitdiffstats
path: root/components/data_reduction_proxy
diff options
context:
space:
mode:
authorbengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 04:41:35 +0000
committerbengr@chromium.org <bengr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 04:41:35 +0000
commite0791baf6eb95b7abaecf7b85202a9f8466f8a60 (patch)
treec97819d596580689e7b72ebe2cae6010830d776b /components/data_reduction_proxy
parentaa2ec2a1dd5a255395d38c4b833239e1731ec54a (diff)
downloadchromium_src-e0791baf6eb95b7abaecf7b85202a9f8466f8a60.zip
chromium_src-e0791baf6eb95b7abaecf7b85202a9f8466f8a60.tar.gz
chromium_src-e0791baf6eb95b7abaecf7b85202a9f8466f8a60.tar.bz2
Removed requirement that data reduction proxy key be non-empty
The removes a check on initialization, because the key may be set after initialization but before use. BUG=382977 Review URL: https://codereview.chromium.org/347803003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/data_reduction_proxy')
-rw-r--r--components/data_reduction_proxy/browser/data_reduction_proxy_params.cc7
-rw-r--r--components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc29
2 files changed, 4 insertions, 32 deletions
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
index d3a3890..ce69157 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params.cc
@@ -137,13 +137,6 @@ bool DataReductionProxyParams::Init(
return false;
}
- if (allowed || alt_allowed) {
- if (key_.empty()) {
- DVLOG(1) << "Invalid key: <empty>";
- return false;
- }
- }
-
if (fallback_allowed_ && !allowed_) {
DVLOG(1) << "The data reduction proxy fallback cannot be allowed if "
<< "the data reduction proxy is not allowed";
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc
index 725acf1..fac9d2d 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc
@@ -200,27 +200,6 @@ TEST_F(DataReductionProxyParamsTest, Flags) {
kFlagProbeURL);
}
-TEST_F(DataReductionProxyParamsTest, FlagsNoKey) {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionProxy, kFlagOrigin);
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionProxyFallback, kFlagFallbackOrigin);
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionSSLProxy, kFlagSSLOrigin);
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionProxyAlt, kFlagAltOrigin);
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionProxyAltFallback, kFlagAltFallbackOrigin);
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kDataReductionProxyProbeURL, kFlagProbeURL);
- TestDataReductionProxyParams params(
- DataReductionProxyParams::kAllowed |
- DataReductionProxyParams::kFallbackAllowed |
- DataReductionProxyParams::kAlternativeAllowed |
- DataReductionProxyParams::kPromoAllowed, HAS_EVERYTHING);
- EXPECT_FALSE(params.init_result());
-}
-
TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
const struct {
bool allowed;
@@ -231,7 +210,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
bool expected_result;
} tests[] = {
{ true, true, true, true, HAS_NOTHING, true },
- { true, true, true, true, HAS_KEY, false },
+ { true, true, true, true, HAS_KEY, true },
{ true, true, true, true, HAS_DEV_ORIGIN, true },
{ true, true, true, true, HAS_ORIGIN, true },
{ true, true, true, true, HAS_ORIGIN | HAS_DEV_ORIGIN, false },
@@ -242,7 +221,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
{ true, true, true, true, HAS_PROBE_URL, false },
{ true, false, true, true, HAS_NOTHING, true },
- { true, false, true, true, HAS_KEY, false },
+ { true, false, true, true, HAS_KEY, true },
{ true, false, true, true, HAS_ORIGIN | HAS_DEV_ORIGIN, false },
{ true, false, true, true, HAS_FALLBACK_ORIGIN, true },
{ true, false, true, true, HAS_SSL_ORIGIN, false },
@@ -251,7 +230,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
{ true, false, true, true, HAS_PROBE_URL, false },
{ true, true, false, true, HAS_NOTHING, true },
- { true, true, false, true, HAS_KEY, false },
+ { true, true, false, true, HAS_KEY, true },
{ true, true, false, true, HAS_ORIGIN | HAS_DEV_ORIGIN, false },
{ true, true, false, true, HAS_FALLBACK_ORIGIN, false },
{ true, true, false, true, HAS_SSL_ORIGIN, true },
@@ -259,7 +238,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
{ true, true, false, true, HAS_ALT_FALLBACK_ORIGIN, true },
{ true, true, false, true, HAS_PROBE_URL, false },
- { true, false, false, true, HAS_KEY, false },
+ { true, false, false, true, HAS_KEY, true },
{ true, false, false, true, HAS_ORIGIN | HAS_DEV_ORIGIN, false },
{ true, false, false, true, HAS_FALLBACK_ORIGIN, true },
{ true, false, false, true, HAS_SSL_ORIGIN, true },