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

Unified Diff: net/base/test_proxy_delegate.h

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added net/base/test_proxy_delegate.{h,cc} Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/proxy_delegate.h ('k') | net/base/test_proxy_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/test_proxy_delegate.h
diff --git a/net/base/test_proxy_delegate.h b/net/base/test_proxy_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6698c6b8cf4999d56bae8a273c71d88cda33f7d
--- /dev/null
+++ b/net/base/test_proxy_delegate.h
@@ -0,0 +1,86 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_TEST_PROXY_DELEGATE_H_
+#define NET_BASE_TEST_PROXY_DELEGATE_H_
+
+#include <string>
+
+#include "net/base/host_port_pair.h"
+#include "net/base/proxy_delegate.h"
+#include "net/proxy/proxy_server.h"
+
+class GURL;
+
+namespace net {
+
+class HttpRequestHeaders;
+class HttpResponseHeaders;
+class ProxyInfo;
+class ProxyService;
+class URLRequest;
+
+class TestProxyDelegate : public ProxyDelegate {
+ public:
+ TestProxyDelegate();
+ ~TestProxyDelegate() override;
+
+ bool on_before_tunnel_request_called() const {
+ return on_before_tunnel_request_called_;
+ }
+
+ bool on_tunnel_request_completed_called() const {
+ return on_tunnel_request_completed_called_;
+ }
+
+ bool on_tunnel_headers_received_called() const {
+ return on_tunnel_headers_received_called_;
+ }
+
+ void set_trusted_spdy_proxy(const net::ProxyServer& proxy_server) {
+ trusted_spdy_proxy_ = proxy_server;
+ }
+
+ void VerifyOnTunnelRequestCompleted(const std::string& endpoint,
+ const std::string& proxy_server) const;
+
+ void VerifyOnTunnelHeadersReceived(const std::string& origin,
+ const std::string& proxy_server,
+ const std::string& status_line) const;
+
+ // ProxyDelegate implementation:
+ void OnResolveProxy(const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) override;
+ void OnTunnelConnectCompleted(const HostPortPair& endpoint,
+ const HostPortPair& proxy_server,
+ int net_error) override;
+ void OnFallback(const ProxyServer& bad_proxy, int net_error) override;
+ void OnBeforeSendHeaders(URLRequest* request,
+ const ProxyInfo& proxy_info,
+ HttpRequestHeaders* headers) override;
+ void OnBeforeTunnelRequest(const HostPortPair& proxy_server,
+ HttpRequestHeaders* extra_headers) override;
+ void OnTunnelHeadersReceived(
+ const HostPortPair& origin,
+ const HostPortPair& proxy_server,
+ const HttpResponseHeaders& response_headers) override;
+ bool IsTrustedSpdyProxy(const net::ProxyServer& proxy_server) override;
+
+ private:
+ bool on_before_tunnel_request_called_;
+ bool on_tunnel_request_completed_called_;
+ bool on_tunnel_headers_received_called_;
+ net::ProxyServer trusted_spdy_proxy_;
+ HostPortPair on_tunnel_request_completed_endpoint_;
+ HostPortPair on_tunnel_request_completed_proxy_server_;
+ HostPortPair on_tunnel_headers_received_origin_;
+ HostPortPair on_tunnel_headers_received_proxy_server_;
+ std::string on_tunnel_headers_received_status_line_;
+};
+
+} // namespace net
+
+#endif // NET_BASE_TEST_PROXY_DELEGATE_H_
« no previous file with comments | « net/base/proxy_delegate.h ('k') | net/base/test_proxy_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698