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

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

Issue 653313003: Check effective proxy config before adding data reduction proxies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol_unittest.cc
index 16d91f947b4d9e4ea30825631e0a559df60bffa2..87c96c5b5128f31ae802187d9eb4366bf8911334 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_protocol_unittest.cc
@@ -884,6 +884,7 @@ class BadEntropyProvider : public base::FieldTrial::EntropyProvider {
TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) {
int load_flags = net::LOAD_NORMAL;
GURL url("http://www.google.com/");
+ net::ProxyConfig proxy_config = net::ProxyConfig::CreateDirect();
mef 2014/10/30 21:05:36 Given that it is direct and doesn't change, does i
bengr 2014/11/03 23:26:58 Done.
TestDataReductionProxyParams test_params(
DataReductionProxyParams::kAllowed |
@@ -933,13 +934,15 @@ TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) {
// The data reduction proxy is used. It should be used afterwards.
result.Use(data_reduction_proxy_info);
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params, &result);
+ proxy_config, empty_proxy_retry_info,
+ &test_params, &result);
EXPECT_EQ(data_reduction_proxy_info.proxy_server(), result.proxy_server());
// Another proxy is used. It should be used afterwards.
result.Use(other_proxy_info);
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params, &result);
+ proxy_config, empty_proxy_retry_info,
+ &test_params, &result);
EXPECT_EQ(other_proxy_info.proxy_server(), result.proxy_server());
// A direct connection is used. The data reduction proxy should be used
@@ -947,39 +950,40 @@ TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) {
// Another proxy is used. It should be used afterwards.
result.Use(direct_proxy_info);
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params, &result);
+ proxy_config, empty_proxy_retry_info,
+ &test_params, &result);
EXPECT_EQ(data_reduction_proxy_info.proxy_server(), result.proxy_server());
// A direct connection is used, but the data reduction proxy is on the retry
// list. A direct connection should be used afterwards.
result.Use(direct_proxy_info);
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- data_reduction_proxy_retry_info, &test_params,
- &result);
+ proxy_config, data_reduction_proxy_retry_info,
+ &test_params, &result);
EXPECT_TRUE(result.proxy_server().is_direct());
// Without DataCompressionProxyCriticalBypass Finch trial set, should never
// bypass.
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&data_reduction_proxy_info);
EXPECT_FALSE(data_reduction_proxy_info.is_direct());
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&other_proxy_info);
EXPECT_FALSE(other_proxy_info.is_direct());
load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&data_reduction_proxy_info);
EXPECT_FALSE(data_reduction_proxy_info.is_direct());
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&other_proxy_info);
EXPECT_FALSE(other_proxy_info.is_direct());
@@ -994,24 +998,24 @@ TEST_F(DataReductionProxyProtocolTest, OnResolveProxyHandler) {
load_flags = net::LOAD_NORMAL;
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&data_reduction_proxy_info);
EXPECT_FALSE(data_reduction_proxy_info.is_direct());
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&other_proxy_info);
EXPECT_FALSE(other_proxy_info.is_direct());
load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&other_proxy_info);
EXPECT_FALSE(other_proxy_info.is_direct());
OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config,
- empty_proxy_retry_info, &test_params,
+ proxy_config, empty_proxy_retry_info, &test_params,
&data_reduction_proxy_info);
EXPECT_TRUE(data_reduction_proxy_info.is_direct());
}

Powered by Google App Engine
This is Rietveld 408576698