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

Side by Side Diff: net/base/test_proxy_delegate.cc

Issue 2260623002: Race TCP connection to proxies with QUIC connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Cherie's comments Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/base/test_proxy_delegate.h" 5 #include "net/base/test_proxy_delegate.h"
6 6
7 #include "net/http/http_request_headers.h" 7 #include "net/http/http_request_headers.h"
8 #include "net/http/http_response_headers.h" 8 #include "net/http/http_response_headers.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 on_tunnel_headers_received_origin_ = origin; 72 on_tunnel_headers_received_origin_ = origin;
73 on_tunnel_headers_received_proxy_server_ = proxy_server; 73 on_tunnel_headers_received_proxy_server_ = proxy_server;
74 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine(); 74 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine();
75 } 75 }
76 76
77 bool TestProxyDelegate::IsTrustedSpdyProxy( 77 bool TestProxyDelegate::IsTrustedSpdyProxy(
78 const net::ProxyServer& proxy_server) { 78 const net::ProxyServer& proxy_server) {
79 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server; 79 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server;
80 } 80 }
81 81
82 void TestProxyDelegate::GetAlternativeProxy(
83 const GURL& url,
84 const ProxyServer& resolved_proxy_server,
85 ProxyServer* alternative_proxy_server) const {
86 EXPECT_TRUE(resolved_proxy_server.is_valid());
87 EXPECT_FALSE(alternative_proxy_server->is_valid());
88 *alternative_proxy_server = alternative_proxy_server_;
89 }
90
91 void TestProxyDelegate::OnAlternativeProxyBroken(
92 const ProxyServer& alternative_proxy_server) {
93 EXPECT_TRUE(alternative_proxy_server.is_valid());
94 EXPECT_EQ(alternative_proxy_server_, alternative_proxy_server);
95 alternative_proxy_server_ = ProxyServer();
96 }
97
82 } // namespace net 98 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698