Commit 098fc170 authored by bolian's avatar bolian Committed by Commit bot

Make the DataCompressionProxyDevRollout trial be able to override both the...

Make the DataCompressionProxyDevRollout trial be able to override both the primary host and the fallback host of the data reduction proxy.

Related Chrome Android CL:
https://chrome-internal-review.googlesource.com/#/c/175697/

BUG=410961

Review URL: https://codereview.chromium.org/549153003

Cr-Commit-Position: refs/heads/master@{#294035}
parent e7f09286
...@@ -601,6 +601,7 @@ ...@@ -601,6 +601,7 @@
'data_reduction_fallback_host%' : '', 'data_reduction_fallback_host%' : '',
'data_reduction_dev_host%' : '', 'data_reduction_dev_host%' : '',
'data_reduction_dev_fallback_host%' : '',
'spdy_proxy_auth_origin%' : '', 'spdy_proxy_auth_origin%' : '',
'spdy_proxy_auth_property%' : '', 'spdy_proxy_auth_property%' : '',
'spdy_proxy_auth_value%' : '', 'spdy_proxy_auth_value%' : '',
...@@ -967,13 +968,15 @@ ...@@ -967,13 +968,15 @@
'data_reduction_proxy_probe_url%': '', 'data_reduction_proxy_probe_url%': '',
'data_reduction_proxy_warmup_url%': '', 'data_reduction_proxy_warmup_url%': '',
'data_reduction_dev_host%': '', 'data_reduction_dev_host%': '',
'data_reduction_dev_fallback_host%': '',
'data_reduction_fallback_host%': '', 'data_reduction_fallback_host%': '',
}, { }, {
'icu_use_data_file_flag%' : 0, 'icu_use_data_file_flag%' : 0,
'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/', 'spdy_proxy_auth_origin%': 'https://proxy.googlezip.net:443/',
'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect', 'data_reduction_proxy_probe_url%': 'http://check.googlezip.net/connect',
'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204', 'data_reduction_proxy_warmup_url%': 'http://www.gstatic.com/generate_204',
'data_reduction_dev_host%': 'http://proxy-dev.googlezip.net:80/', 'data_reduction_dev_host%': 'https://proxy-dev.googlezip.net:443/',
'data_reduction_dev_fallback_host%': 'http://proxy-dev.googlezip.net:80/',
'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/', 'data_reduction_fallback_host%': 'http://compress.googlezip.net:80/',
}], }],
['OS=="win" or OS=="mac"', { ['OS=="win" or OS=="mac"', {
...@@ -1176,6 +1179,7 @@ ...@@ -1176,6 +1179,7 @@
'native_memory_pressure_signals%': '<(native_memory_pressure_signals)', 'native_memory_pressure_signals%': '<(native_memory_pressure_signals)',
'data_reduction_fallback_host%': '<(data_reduction_fallback_host)', 'data_reduction_fallback_host%': '<(data_reduction_fallback_host)',
'data_reduction_dev_host%': '<(data_reduction_dev_host)', 'data_reduction_dev_host%': '<(data_reduction_dev_host)',
'data_reduction_dev_fallback_host%': '<(data_reduction_dev_fallback_host)',
'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)', 'spdy_proxy_auth_origin%': '<(spdy_proxy_auth_origin)',
'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)', 'spdy_proxy_auth_property%': '<(spdy_proxy_auth_property)',
'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)', 'spdy_proxy_auth_value%': '<(spdy_proxy_auth_value)',
...@@ -2894,6 +2898,10 @@ ...@@ -2894,6 +2898,10 @@
'defines': [ 'defines': [
'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'], 'DATA_REDUCTION_DEV_HOST="<(data_reduction_dev_host)"'],
}], }],
['data_reduction_dev_fallback_host != ""', {
'defines': [
'DATA_REDUCTION_DEV_FALLBACK_HOST="<(data_reduction_dev_fallback_host)"'],
}],
['spdy_proxy_auth_origin != ""', { ['spdy_proxy_auth_origin != ""', {
'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'], 'defines': ['SPDY_PROXY_AUTH_ORIGIN="<(spdy_proxy_auth_origin)"'],
}], }],
......
...@@ -135,7 +135,8 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, Authorization) { ...@@ -135,7 +135,8 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, Authorization) {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN));
TestDataReductionProxyAuthRequestHandler auth_handler(kClient, TestDataReductionProxyAuthRequestHandler auth_handler(kClient,
kVersion, kVersion,
params.get(), params.get(),
...@@ -219,7 +220,8 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, AuthorizationBogusVersion) { ...@@ -219,7 +220,8 @@ TEST_F(DataReductionProxyAuthRequestHandlerTest, AuthorizationBogusVersion) {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN));
TestDataReductionProxyAuthRequestHandler auth_handler(kClient, TestDataReductionProxyAuthRequestHandler auth_handler(kClient,
kBogusVersion, kBogusVersion,
params.get(), params.get(),
......
...@@ -252,6 +252,8 @@ void DataReductionProxyParams::InitWithoutChecks() { ...@@ -252,6 +252,8 @@ void DataReductionProxyParams::InitWithoutChecks() {
origin = GetDefaultDevOrigin(); origin = GetDefaultDevOrigin();
if (origin.empty()) if (origin.empty())
origin = GetDefaultOrigin(); origin = GetDefaultOrigin();
if (fallback_origin.empty())
fallback_origin = GetDefaultDevFallbackOrigin();
if (fallback_origin.empty()) if (fallback_origin.empty())
fallback_origin = GetDefaultFallbackOrigin(); fallback_origin = GetDefaultFallbackOrigin();
if (ssl_origin.empty()) if (ssl_origin.empty())
...@@ -396,6 +398,20 @@ std::string DataReductionProxyParams::GetDefaultDevOrigin() const { ...@@ -396,6 +398,20 @@ std::string DataReductionProxyParams::GetDefaultDevOrigin() const {
return std::string(); return std::string();
} }
std::string DataReductionProxyParams::GetDefaultDevFallbackOrigin() const {
#if defined(DATA_REDUCTION_DEV_FALLBACK_HOST)
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev))
return std::string();
if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) ||
(FieldTrialList::FindFullName("DataCompressionProxyDevRollout") ==
kEnabled)) {
return DATA_REDUCTION_DEV_FALLBACK_HOST;
}
#endif
return std::string();
}
bool DataReductionProxyParams::AreDataReductionProxiesBypassed( bool DataReductionProxyParams::AreDataReductionProxiesBypassed(
const net::URLRequest& request, base::TimeDelta* min_retry_delay) const { const net::URLRequest& request, base::TimeDelta* min_retry_delay) const {
if (request.context() != NULL && if (request.context() != NULL &&
......
...@@ -250,6 +250,7 @@ class DataReductionProxyParams { ...@@ -250,6 +250,7 @@ class DataReductionProxyParams {
// Returns the corresponding string from preprocessor constants if defined, // Returns the corresponding string from preprocessor constants if defined,
// and an empty string otherwise. // and an empty string otherwise.
virtual std::string GetDefaultDevOrigin() const; virtual std::string GetDefaultDevOrigin() const;
virtual std::string GetDefaultDevFallbackOrigin() const;
virtual std::string GetDefaultOrigin() const; virtual std::string GetDefaultOrigin() const;
virtual std::string GetDefaultFallbackOrigin() const; virtual std::string GetDefaultFallbackOrigin() const;
virtual std::string GetDefaultSSLOrigin() const; virtual std::string GetDefaultSSLOrigin() const;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace { namespace {
// Test values to replace the values specified in preprocessor defines. // Test values to replace the values specified in preprocessor defines.
static const char kDefaultDevOrigin[] = "https://dev.net:443/"; static const char kDefaultDevOrigin[] = "https://dev.net:443/";
static const char kDefaultDevFallbackOrigin[] = "http://dev.net:80/";
static const char kDefaultOrigin[] = "https://origin.net:443/"; static const char kDefaultOrigin[] = "https://origin.net:443/";
static const char kDefaultFallbackOrigin[] = "http://fallback.net:80/"; static const char kDefaultFallbackOrigin[] = "http://fallback.net:80/";
static const char kDefaultSSLOrigin[] = "http://ssl.net:1080/"; static const char kDefaultSSLOrigin[] = "http://ssl.net:1080/";
...@@ -41,6 +42,10 @@ std::string TestDataReductionProxyParams::DefaultDevOrigin() { ...@@ -41,6 +42,10 @@ std::string TestDataReductionProxyParams::DefaultDevOrigin() {
return kDefaultDevOrigin; return kDefaultDevOrigin;
} }
std::string TestDataReductionProxyParams::DefaultDevFallbackOrigin() {
return kDefaultDevFallbackOrigin;
}
std::string TestDataReductionProxyParams::DefaultOrigin() { std::string TestDataReductionProxyParams::DefaultOrigin() {
return kDefaultOrigin; return kDefaultOrigin;
} }
...@@ -94,6 +99,12 @@ std::string TestDataReductionProxyParams::GetDefaultDevOrigin() const { ...@@ -94,6 +99,12 @@ std::string TestDataReductionProxyParams::GetDefaultDevOrigin() const {
TestDataReductionProxyParams::HAS_DEV_ORIGIN, kDefaultDevOrigin); TestDataReductionProxyParams::HAS_DEV_ORIGIN, kDefaultDevOrigin);
} }
std::string TestDataReductionProxyParams::GetDefaultDevFallbackOrigin() const {
return GetDefinition(
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
kDefaultDevFallbackOrigin);
}
std::string TestDataReductionProxyParams::GetDefaultOrigin() const { std::string TestDataReductionProxyParams::GetDefaultOrigin() const {
return GetDefinition( return GetDefinition(
TestDataReductionProxyParams::HAS_ORIGIN, kDefaultOrigin); TestDataReductionProxyParams::HAS_ORIGIN, kDefaultOrigin);
......
...@@ -21,6 +21,7 @@ class TestDataReductionProxyParams : public DataReductionProxyParams { ...@@ -21,6 +21,7 @@ class TestDataReductionProxyParams : public DataReductionProxyParams {
HAS_ALT_ORIGIN = 0x10, HAS_ALT_ORIGIN = 0x10,
HAS_ALT_FALLBACK_ORIGIN = 0x20, HAS_ALT_FALLBACK_ORIGIN = 0x20,
HAS_PROBE_URL = 0x40, HAS_PROBE_URL = 0x40,
HAS_DEV_FALLBACK_ORIGIN = 0x80,
HAS_EVERYTHING = 0xff, HAS_EVERYTHING = 0xff,
}; };
...@@ -30,6 +31,7 @@ class TestDataReductionProxyParams : public DataReductionProxyParams { ...@@ -30,6 +31,7 @@ class TestDataReductionProxyParams : public DataReductionProxyParams {
// Test values to replace the values specified in preprocessor defines. // Test values to replace the values specified in preprocessor defines.
static std::string DefaultDevOrigin(); static std::string DefaultDevOrigin();
static std::string DefaultDevFallbackOrigin();
static std::string DefaultOrigin(); static std::string DefaultOrigin();
static std::string DefaultFallbackOrigin(); static std::string DefaultFallbackOrigin();
static std::string DefaultSSLOrigin(); static std::string DefaultSSLOrigin();
...@@ -47,6 +49,8 @@ class TestDataReductionProxyParams : public DataReductionProxyParams { ...@@ -47,6 +49,8 @@ class TestDataReductionProxyParams : public DataReductionProxyParams {
protected: protected:
virtual std::string GetDefaultDevOrigin() const OVERRIDE; virtual std::string GetDefaultDevOrigin() const OVERRIDE;
virtual std::string GetDefaultDevFallbackOrigin() const OVERRIDE;
virtual std::string GetDefaultOrigin() const OVERRIDE; virtual std::string GetDefaultOrigin() const OVERRIDE;
virtual std::string GetDefaultFallbackOrigin() const OVERRIDE; virtual std::string GetDefaultFallbackOrigin() const OVERRIDE;
......
...@@ -54,7 +54,7 @@ TEST_F(DataReductionProxyParamsTest, EverythingDefined) { ...@@ -54,7 +54,7 @@ TEST_F(DataReductionProxyParamsTest, EverythingDefined) {
CheckParams(params, true, true, true, false, true); CheckParams(params, true, true, true, false, true);
CheckValues(params, CheckValues(params,
TestDataReductionProxyParams::DefaultDevOrigin(), TestDataReductionProxyParams::DefaultDevOrigin(),
TestDataReductionProxyParams::DefaultFallbackOrigin(), TestDataReductionProxyParams::DefaultDevFallbackOrigin(),
TestDataReductionProxyParams::DefaultSSLOrigin(), TestDataReductionProxyParams::DefaultSSLOrigin(),
TestDataReductionProxyParams::DefaultAltOrigin(), TestDataReductionProxyParams::DefaultAltOrigin(),
TestDataReductionProxyParams::DefaultAltFallbackOrigin(), TestDataReductionProxyParams::DefaultAltFallbackOrigin(),
...@@ -67,7 +67,8 @@ TEST_F(DataReductionProxyParamsTest, NoDevOrigin) { ...@@ -67,7 +67,8 @@ TEST_F(DataReductionProxyParamsTest, NoDevOrigin) {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN);
CheckParams(params, true, true, true, false, true); CheckParams(params, true, true, true, false, true);
CheckValues(params, CheckValues(params,
TestDataReductionProxyParams::DefaultOrigin(), TestDataReductionProxyParams::DefaultOrigin(),
...@@ -135,7 +136,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -135,7 +136,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
true, true,
true, true,
true, true,
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
true true
}, },
{ {
...@@ -152,14 +154,16 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -152,14 +154,16 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
true, true,
true, true,
TestDataReductionProxyParams::HAS_ORIGIN | TestDataReductionProxyParams::HAS_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ true, { true,
true, true,
true, true,
true, true,
TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN, TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ true, { true,
...@@ -204,7 +208,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -204,7 +208,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
true, true,
true, true,
TestDataReductionProxyParams::HAS_ORIGIN | TestDataReductionProxyParams::HAS_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ {
...@@ -262,7 +267,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -262,7 +267,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
false, false,
true, true,
TestDataReductionProxyParams::HAS_ORIGIN | TestDataReductionProxyParams::HAS_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ {
...@@ -270,7 +276,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -270,7 +276,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
true, true,
false, false,
true, true,
TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN, TestDataReductionProxyParams::HAS_FALLBACK_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ {
...@@ -311,7 +318,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -311,7 +318,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
false, false,
true, true,
TestDataReductionProxyParams::HAS_ORIGIN | TestDataReductionProxyParams::HAS_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ {
...@@ -368,7 +376,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -368,7 +376,8 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
true, true,
true, true,
TestDataReductionProxyParams::HAS_ORIGIN | TestDataReductionProxyParams::HAS_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_ORIGIN, TestDataReductionProxyParams::HAS_DEV_ORIGIN |
TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN,
false false
}, },
{ {
...@@ -427,7 +436,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) { ...@@ -427,7 +436,7 @@ TEST_F(DataReductionProxyParamsTest, InvalidConfigurations) {
flags, flags,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~(tests[i].missing_definitions)); ~(tests[i].missing_definitions));
EXPECT_EQ(tests[i].expected_result, params.init_result()); EXPECT_EQ(tests[i].expected_result, params.init_result()) << i;
} }
} }
...@@ -559,7 +568,7 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) { ...@@ -559,7 +568,7 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) {
net::HostPortPair::FromURL(GURL( net::HostPortPair::FromURL(GURL(
TestDataReductionProxyParams::DefaultDevOrigin())), TestDataReductionProxyParams::DefaultDevOrigin())),
net::HostPortPair::FromURL(GURL( net::HostPortPair::FromURL(GURL(
TestDataReductionProxyParams::DefaultFallbackOrigin())), TestDataReductionProxyParams::DefaultDevFallbackOrigin())),
false, false,
false, false,
false false
...@@ -572,7 +581,7 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) { ...@@ -572,7 +581,7 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) {
net::HostPortPair::FromURL(GURL( net::HostPortPair::FromURL(GURL(
TestDataReductionProxyParams::DefaultOrigin())), TestDataReductionProxyParams::DefaultOrigin())),
net::HostPortPair::FromURL(GURL( net::HostPortPair::FromURL(GURL(
TestDataReductionProxyParams::DefaultFallbackOrigin())), TestDataReductionProxyParams::DefaultDevFallbackOrigin())),
false, false,
false, false,
false false
...@@ -586,19 +595,21 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) { ...@@ -586,19 +595,21 @@ TEST_F(DataReductionProxyParamsTest, IsDataReductionProxy) {
unsigned int has_definitions = TestDataReductionProxyParams::HAS_EVERYTHING; unsigned int has_definitions = TestDataReductionProxyParams::HAS_EVERYTHING;
if (!tests[i].set_dev_origin) { if (!tests[i].set_dev_origin) {
has_definitions &= ~TestDataReductionProxyParams::HAS_DEV_ORIGIN; has_definitions &= ~TestDataReductionProxyParams::HAS_DEV_ORIGIN;
has_definitions &= ~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN;
} }
TestDataReductionProxyParams params(flags, has_definitions); TestDataReductionProxyParams params(flags, has_definitions);
DataReductionProxyTypeInfo proxy_type_info; DataReductionProxyTypeInfo proxy_type_info;
EXPECT_EQ(tests[i].expected_result, EXPECT_EQ(tests[i].expected_result,
params.IsDataReductionProxy( params.IsDataReductionProxy(
tests[i].host_port_pair, &proxy_type_info)); tests[i].host_port_pair, &proxy_type_info)) << i;
EXPECT_TRUE(tests[i].expected_first.Equals( EXPECT_TRUE(tests[i].expected_first.Equals(
net::HostPortPair::FromURL(proxy_type_info.proxy_servers.first))); net::HostPortPair::FromURL(proxy_type_info.proxy_servers.first))) << i;
EXPECT_TRUE(tests[i].expected_second.Equals( EXPECT_TRUE(tests[i].expected_second.Equals(
net::HostPortPair::FromURL(proxy_type_info.proxy_servers.second))); net::HostPortPair::FromURL(proxy_type_info.proxy_servers.second))) << i;
EXPECT_EQ(tests[i].expected_is_fallback, proxy_type_info.is_fallback); EXPECT_EQ(tests[i].expected_is_fallback, proxy_type_info.is_fallback) << i;
EXPECT_EQ(tests[i].expected_is_alternative, proxy_type_info.is_alternative); EXPECT_EQ(tests[i].expected_is_alternative, proxy_type_info.is_alternative)
EXPECT_EQ(tests[i].expected_is_ssl, proxy_type_info.is_ssl); << i;
EXPECT_EQ(tests[i].expected_is_ssl, proxy_type_info.is_ssl) << i;
} }
} }
...@@ -965,7 +976,8 @@ TEST_F(DataReductionProxyParamsTest, AreProxiesBypassed) { ...@@ -965,7 +976,8 @@ TEST_F(DataReductionProxyParamsTest, AreProxiesBypassed) {
flags |= DataReductionProxyParams::kFallbackAllowed; flags |= DataReductionProxyParams::kFallbackAllowed;
unsigned int has_definitions = unsigned int has_definitions =
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN; ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN;
TestDataReductionProxyParams params(flags, has_definitions); TestDataReductionProxyParams params(flags, has_definitions);
net::ProxyRetryInfoMap retry_map; net::ProxyRetryInfoMap retry_map;
......
...@@ -95,7 +95,8 @@ class DataReductionProxyProtocolTest : public testing::Test { ...@@ -95,7 +95,8 @@ class DataReductionProxyProtocolTest : public testing::Test {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN));
} }
// Sets up the |TestURLRequestContext| with the provided |ProxyService| and // Sets up the |TestURLRequestContext| with the provided |ProxyService| and
...@@ -793,7 +794,8 @@ TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) { ...@@ -793,7 +794,8 @@ TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN);
// Data reduction proxy info // Data reduction proxy info
net::ProxyInfo data_reduction_proxy_info; net::ProxyInfo data_reduction_proxy_info;
......
...@@ -114,7 +114,8 @@ void DataReductionProxySettingsTestBase::SetUp() { ...@@ -114,7 +114,8 @@ void DataReductionProxySettingsTestBase::SetUp() {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN));
} }
template <class C> template <class C>
......
...@@ -63,11 +63,13 @@ class MockDataReductionProxySettings : public C { ...@@ -63,11 +63,13 @@ class MockDataReductionProxySettings : public C {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)) {} ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)) {}
MockDataReductionProxySettings<C>(int flags) MockDataReductionProxySettings<C>(int flags)
: C(new TestDataReductionProxyParams(flags, : C(new TestDataReductionProxyParams(flags,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN)) {} ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN)) {}
MOCK_METHOD0(GetURLFetcherForAvailabilityCheck, net::URLFetcher*()); MOCK_METHOD0(GetURLFetcherForAvailabilityCheck, net::URLFetcher*());
MOCK_METHOD0(GetURLFetcherForWarmup, net::URLFetcher*()); MOCK_METHOD0(GetURLFetcherForWarmup, net::URLFetcher*());
MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*()); MOCK_METHOD0(GetOriginalProfilePrefs, PrefService*());
......
...@@ -75,7 +75,8 @@ TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) { ...@@ -75,7 +75,8 @@ TEST_F(DataReductionProxySettingsTest, TestSetProxyConfigs) {
DataReductionProxyParams::kFallbackAllowed | DataReductionProxyParams::kFallbackAllowed |
DataReductionProxyParams::kPromoAllowed, DataReductionProxyParams::kPromoAllowed,
TestDataReductionProxyParams::HAS_EVERYTHING & TestDataReductionProxyParams::HAS_EVERYTHING &
~TestDataReductionProxyParams::HAS_DEV_ORIGIN); ~TestDataReductionProxyParams::HAS_DEV_ORIGIN &
~TestDataReductionProxyParams::HAS_DEV_FALLBACK_ORIGIN);
CommandLine::ForCurrentProcess()->AppendSwitchASCII( CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kDataReductionProxyAlt, drp_params.DefaultAltOrigin()); switches::kDataReductionProxyAlt, drp_params.DefaultAltOrigin());
CommandLine::ForCurrentProcess()->AppendSwitchASCII( CommandLine::ForCurrentProcess()->AppendSwitchASCII(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment