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

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: 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 #include "url/gurl.h"
RyanSturm 2016/08/19 19:03:23 Not sure you really need this header since you don
tbansal1 2016/08/20 01:53:39 Done.
10 11
11 namespace net { 12 namespace net {
12 13
13 TestProxyDelegate::TestProxyDelegate() 14 TestProxyDelegate::TestProxyDelegate()
14 : on_before_tunnel_request_called_(false), 15 : on_before_tunnel_request_called_(false),
15 on_tunnel_request_completed_called_(false), 16 on_tunnel_request_completed_called_(false),
16 on_tunnel_headers_received_called_(false) {} 17 on_tunnel_headers_received_called_(false) {}
17 18
18 TestProxyDelegate::~TestProxyDelegate() {} 19 TestProxyDelegate::~TestProxyDelegate() {}
19 20
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 on_tunnel_headers_received_origin_ = origin; 73 on_tunnel_headers_received_origin_ = origin;
73 on_tunnel_headers_received_proxy_server_ = proxy_server; 74 on_tunnel_headers_received_proxy_server_ = proxy_server;
74 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine(); 75 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine();
75 } 76 }
76 77
77 bool TestProxyDelegate::IsTrustedSpdyProxy( 78 bool TestProxyDelegate::IsTrustedSpdyProxy(
78 const net::ProxyServer& proxy_server) { 79 const net::ProxyServer& proxy_server) {
79 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server; 80 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server;
80 } 81 }
81 82
83 void TestProxyDelegate::GetAlternativeProxy(
84 const GURL& url,
85 const ProxyServer& resolved_proxy_server,
86 ProxyServer* alternative_proxy_server) const {
87 EXPECT_TRUE(resolved_proxy_server.is_valid());
88 EXPECT_FALSE(alternative_proxy_server->is_valid());
89 *alternative_proxy_server = alternative_proxy_server_;
90 }
91
92 void TestProxyDelegate::SetAlternativeProxy(
93 const ProxyServer& alternative_proxy_server) {
94 alternative_proxy_server_ = alternative_proxy_server;
95 }
96
97 void TestProxyDelegate::OnAlternativeProxyBroken(
98 const ProxyServer& alternative_proxy_server) {
99 EXPECT_TRUE(alternative_proxy_server.is_valid());
100 EXPECT_EQ(alternative_proxy_server_, alternative_proxy_server);
101 alternative_proxy_server_ = ProxyServer();
102 }
103
82 } // namespace net 104 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698