Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc |
index 9bba71559543bee418bc89c011928d828eb31859..10f3bc4d05cfe9ba717d80798d6622e0d9796f18 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc |
@@ -342,63 +342,71 @@ TEST_F(DataReductionProxyDelegateTest, OnResolveProxyHandler) { |
net::ProxyRetryInfo retry_info; |
retry_info.current_delay = base::TimeDelta::FromSeconds(1000); |
retry_info.bad_until = base::TimeTicks().Now() + retry_info.current_delay; |
retry_info.try_while_bad = false; |
data_reduction_proxy_retry_info[data_reduction_proxy_info.proxy_server() |
.ToURI()] = retry_info; |
net::ProxyInfo result; |
// Another proxy is used. It should be used afterwards. |
result.Use(other_proxy_info); |
- OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
+ OnResolveProxyHandler(url, "GET", load_flags, data_reduction_proxy_config, |
empty_proxy_retry_info, config(), &result); |
EXPECT_EQ(other_proxy_info.proxy_server(), result.proxy_server()); |
// A direct connection is used. The data reduction proxy should be used |
// afterwards. |
// Another proxy is used. It should be used afterwards. |
result.Use(direct_proxy_info); |
net::ProxyConfig::ID prev_id = result.config_id(); |
- OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
+ OnResolveProxyHandler(url, "GET", load_flags, data_reduction_proxy_config, |
empty_proxy_retry_info, config(), &result); |
EXPECT_EQ(data_reduction_proxy_info.proxy_server(), result.proxy_server()); |
// Only the proxy list should be updated, not he proxy info. |
EXPECT_EQ(result.config_id(), prev_id); |
// 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); |
prev_id = result.config_id(); |
- OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
+ OnResolveProxyHandler(url, "GET", load_flags, data_reduction_proxy_config, |
data_reduction_proxy_retry_info, config(), &result); |
EXPECT_TRUE(result.proxy_server().is_direct()); |
EXPECT_EQ(result.config_id(), prev_id); |
// Test that ws:// and wss:// URLs bypass the data reduction proxy. |
result.UseDirect(); |
- OnResolveProxyHandler(GURL("ws://echo.websocket.org/"), load_flags, |
+ OnResolveProxyHandler(GURL("ws://echo.websocket.org/"), "GET", load_flags, |
data_reduction_proxy_config, empty_proxy_retry_info, |
config(), &result); |
EXPECT_TRUE(result.is_direct()); |
- OnResolveProxyHandler(GURL("wss://echo.websocket.org/"), load_flags, |
+ result.UseDirect(); |
+ OnResolveProxyHandler(GURL("wss://echo.websocket.org/"), "GET", load_flags, |
data_reduction_proxy_config, empty_proxy_retry_info, |
config(), &result); |
EXPECT_TRUE(result.is_direct()); |
+ // POST methods go direct. |
+ result.UseDirect(); |
+ OnResolveProxyHandler(url, "POST", load_flags, data_reduction_proxy_config, |
+ empty_proxy_retry_info, config(), &result); |
+ EXPECT_TRUE(result.is_direct()); |
+ |
// Without DataCompressionProxyCriticalBypass Finch trial set, the |
// BYPASS_DATA_REDUCTION_PROXY load flag should be ignored. |
- OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
+ result.UseDirect(); |
+ OnResolveProxyHandler(url, "GET", load_flags, data_reduction_proxy_config, |
empty_proxy_retry_info, config(), &result); |
EXPECT_FALSE(result.is_direct()); |
- OnResolveProxyHandler(url, load_flags, data_reduction_proxy_config, |
+ OnResolveProxyHandler(url, "GET", load_flags, data_reduction_proxy_config, |
empty_proxy_retry_info, config(), &other_proxy_info); |
EXPECT_FALSE(other_proxy_info.is_direct()); |
} |
#if defined(OS_ANDROID) |
#define MAYBE_OnCompletedInternalLoFi DISABLED_OnCompletedInternalLoFi |
#else |
#define MAYBE_OnCompletedInternalLoFi OnCompletedInternalLoFi |
#endif |