OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 EXPECT_TRUE(on_tunnel_headers_received_called_); | 34 EXPECT_TRUE(on_tunnel_headers_received_called_); |
35 EXPECT_TRUE(HostPortPair::FromString(origin).Equals( | 35 EXPECT_TRUE(HostPortPair::FromString(origin).Equals( |
36 on_tunnel_headers_received_origin_)); | 36 on_tunnel_headers_received_origin_)); |
37 EXPECT_TRUE(HostPortPair::FromString(proxy_server) | 37 EXPECT_TRUE(HostPortPair::FromString(proxy_server) |
38 .Equals(on_tunnel_headers_received_proxy_server_)); | 38 .Equals(on_tunnel_headers_received_proxy_server_)); |
39 EXPECT_EQ(status_line, on_tunnel_headers_received_status_line_); | 39 EXPECT_EQ(status_line, on_tunnel_headers_received_status_line_); |
40 } | 40 } |
41 | 41 |
42 void TestProxyDelegate::OnResolveProxy(const GURL& url, | 42 void TestProxyDelegate::OnResolveProxy(const GURL& url, |
43 const std::string& method, | 43 const std::string& method, |
44 int load_flags, | |
45 const ProxyService& proxy_service, | 44 const ProxyService& proxy_service, |
46 ProxyInfo* result) {} | 45 ProxyInfo* result) {} |
47 | 46 |
48 void TestProxyDelegate::OnTunnelConnectCompleted( | 47 void TestProxyDelegate::OnTunnelConnectCompleted( |
49 const HostPortPair& endpoint, | 48 const HostPortPair& endpoint, |
50 const HostPortPair& proxy_server, | 49 const HostPortPair& proxy_server, |
51 int net_error) { | 50 int net_error) { |
52 on_tunnel_request_completed_called_ = true; | 51 on_tunnel_request_completed_called_ = true; |
53 on_tunnel_request_completed_endpoint_ = endpoint; | 52 on_tunnel_request_completed_endpoint_ = endpoint; |
54 on_tunnel_request_completed_proxy_server_ = proxy_server; | 53 on_tunnel_request_completed_proxy_server_ = proxy_server; |
(...skipping 19 matching lines...) Expand all Loading... |
74 on_tunnel_headers_received_proxy_server_ = proxy_server; | 73 on_tunnel_headers_received_proxy_server_ = proxy_server; |
75 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine(); | 74 on_tunnel_headers_received_status_line_ = response_headers.GetStatusLine(); |
76 } | 75 } |
77 | 76 |
78 bool TestProxyDelegate::IsTrustedSpdyProxy( | 77 bool TestProxyDelegate::IsTrustedSpdyProxy( |
79 const net::ProxyServer& proxy_server) { | 78 const net::ProxyServer& proxy_server) { |
80 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server; | 79 return proxy_server.is_valid() && trusted_spdy_proxy_ == proxy_server; |
81 } | 80 } |
82 | 81 |
83 } // namespace net | 82 } // namespace net |
OLD | NEW |