Commit 0391069e authored by kundaji's avatar kundaji Committed by Commit bot

Pass in bad proxy to NotifyProxyFallback and not the successful one.

This cl fixes a bug which was causing the final successful proxy
to be passed to NotifyProxyFallback rather than the proxy for which
fallback happened.

BUG=395769

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

Cr-Commit-Position: refs/heads/master@{#294039}
parent 992e0f97
......@@ -1249,8 +1249,10 @@ void ProxyService::ReportSuccess(const ProxyInfo& result,
if (existing == proxy_retry_info_.end()) {
proxy_retry_info_[iter->first] = iter->second;
if (network_delegate) {
const ProxyServer& bad_proxy =
ProxyServer::FromURI(iter->first, ProxyServer::SCHEME_HTTP);
const ProxyRetryInfo& proxy_retry_info = iter->second;
network_delegate->NotifyProxyFallback(result.proxy_server(),
network_delegate->NotifyProxyFallback(bad_proxy,
proxy_retry_info.net_error);
}
}
......
......@@ -962,7 +962,7 @@ TEST_F(ProxyServiceTest, ProxyFallback) {
// first proxy as bad.
TestProxyFallbackNetworkDelegate test_delegate;
service.ReportSuccess(info, &test_delegate);
EXPECT_EQ(info.proxy_server(), test_delegate.proxy_server());
EXPECT_EQ("foopy1:8080", test_delegate.proxy_server().ToURI());
EXPECT_EQ(net::ERR_PROXY_CONNECTION_FAILED,
test_delegate.proxy_fallback_net_error());
......
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