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

Side by Side Diff: net/proxy/proxy_service_unittest.cc

Issue 556933003: Pass in bad proxy to NotifyProxyFallback and not the successful one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add all files to cl Created 6 years, 3 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 unified diff | Download patch
« net/proxy/proxy_service.cc ('K') | « net/proxy/proxy_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 // Proxy times should not have been modified by fallback. 955 // Proxy times should not have been modified by fallback.
956 EXPECT_EQ(proxy_resolve_start_time, info.proxy_resolve_start_time()); 956 EXPECT_EQ(proxy_resolve_start_time, info.proxy_resolve_start_time());
957 EXPECT_EQ(proxy_resolve_end_time, info.proxy_resolve_end_time()); 957 EXPECT_EQ(proxy_resolve_end_time, info.proxy_resolve_end_time());
958 958
959 // The second proxy should be specified. 959 // The second proxy should be specified.
960 EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI()); 960 EXPECT_EQ("foopy2:9090", info.proxy_server().ToURI());
961 // Report back that the second proxy worked. This will globally mark the 961 // Report back that the second proxy worked. This will globally mark the
962 // first proxy as bad. 962 // first proxy as bad.
963 TestProxyFallbackNetworkDelegate test_delegate; 963 TestProxyFallbackNetworkDelegate test_delegate;
964 service.ReportSuccess(info, &test_delegate); 964 service.ReportSuccess(info, &test_delegate);
965 EXPECT_EQ(info.proxy_server(), test_delegate.proxy_server()); 965 EXPECT_EQ("foopy1:8080", test_delegate.proxy_server().ToURI());
966 EXPECT_EQ(net::ERR_PROXY_CONNECTION_FAILED, 966 EXPECT_EQ(net::ERR_PROXY_CONNECTION_FAILED,
967 test_delegate.proxy_fallback_net_error()); 967 test_delegate.proxy_fallback_net_error());
968 968
969 TestCompletionCallback callback3; 969 TestCompletionCallback callback3;
970 rv = service.ResolveProxy( 970 rv = service.ResolveProxy(
971 url, net::LOAD_NORMAL, &info, callback3.callback(), NULL, NULL, 971 url, net::LOAD_NORMAL, &info, callback3.callback(), NULL, NULL,
972 BoundNetLog()); 972 BoundNetLog());
973 EXPECT_EQ(ERR_IO_PENDING, rv); 973 EXPECT_EQ(ERR_IO_PENDING, rv);
974 974
975 ASSERT_EQ(1u, resolver->pending_requests().size()); 975 ASSERT_EQ(1u, resolver->pending_requests().size());
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3075 ProxyInfo info3; 3075 ProxyInfo info3;
3076 TestCompletionCallback callback3; 3076 TestCompletionCallback callback3;
3077 rv = service.ResolveProxy( 3077 rv = service.ResolveProxy(
3078 GURL("http://request3"), net::LOAD_NORMAL, &info3, callback3.callback(), 3078 GURL("http://request3"), net::LOAD_NORMAL, &info3, callback3.callback(),
3079 NULL, NULL, BoundNetLog()); 3079 NULL, NULL, BoundNetLog());
3080 EXPECT_EQ(OK, rv); 3080 EXPECT_EQ(OK, rv);
3081 EXPECT_TRUE(info3.is_direct()); 3081 EXPECT_TRUE(info3.is_direct());
3082 } 3082 }
3083 3083
3084 } // namespace net 3084 } // namespace net
OLDNEW
« net/proxy/proxy_service.cc ('K') | « net/proxy/proxy_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698