| 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 7c24d0c4acecd4b3dfdb353fb778474b9110da56..150d1f9963fb22dac7c2b8e3b5377972eadeb1f0 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
|
| @@ -343,63 +343,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(GURL("ws://echo.websocket.org/"), "GET", load_flags,
|
| 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("wss://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());
|
| }
|
|
|
| // Verifies that requests that were not proxied through data saver proxy due to
|
| // missing config are recorded properly.
|
| TEST_F(DataReductionProxyDelegateTest, HTTPRequests) {
|
| const struct {
|
| std::string url;
|
| bool enabled_by_user;
|
|
|