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

Unified Diff: net/websockets/websocket_end_to_end_test.cc

Issue 1735203002: Revert of Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_end_to_end_test.cc
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index 3dcf3361ce2b9621e40a8e619f567704270d82fc..bb1d9519b18b083f5ab530532324088c6d05f4f7 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -22,7 +22,7 @@
#include "base/strings/string_piece.h"
#include "base/thread_task_runner_handle.h"
#include "net/base/auth.h"
-#include "net/base/proxy_delegate.h"
+#include "net/base/network_delegate.h"
#include "net/base/test_data_directory.h"
#include "net/proxy/proxy_service.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -195,9 +195,9 @@
// A subclass of TestNetworkDelegate that additionally implements the
// OnResolveProxy callback and records the information passed to it.
-class TestProxyDelegateWithProxyInfo : public ProxyDelegate {
+class TestNetworkDelegateWithProxyInfo : public TestNetworkDelegate {
public:
- TestProxyDelegateWithProxyInfo() {}
+ TestNetworkDelegateWithProxyInfo() {}
struct ResolvedProxyInfo {
GURL url;
@@ -217,34 +217,17 @@
resolved_proxy_info_.proxy_info = *result;
}
- 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 {
- return true;
- }
-
private:
ResolvedProxyInfo resolved_proxy_info_;
- DISALLOW_COPY_AND_ASSIGN(TestProxyDelegateWithProxyInfo);
+ DISALLOW_COPY_AND_ASSIGN(TestNetworkDelegateWithProxyInfo);
};
class WebSocketEndToEndTest : public ::testing::Test {
protected:
WebSocketEndToEndTest()
: event_interface_(),
- proxy_delegate_(new TestProxyDelegateWithProxyInfo),
+ network_delegate_(new TestNetworkDelegateWithProxyInfo),
context_(true),
channel_(),
initialised_context_(false) {}
@@ -253,7 +236,7 @@
// ConnectAndWait(). This method is for the use of tests that need the
// URLRequestContext initialised before calling ConnectAndWait().
void InitialiseContext() {
- context_.set_proxy_delegate(proxy_delegate_.get());
+ context_.set_network_delegate(network_delegate_.get());
context_.Init();
initialised_context_ = true;
}
@@ -274,7 +257,7 @@
}
ConnectTestingEventInterface* event_interface_; // owned by channel_
- scoped_ptr<TestProxyDelegateWithProxyInfo> proxy_delegate_;
+ scoped_ptr<TestNetworkDelegateWithProxyInfo> network_delegate_;
TestURLRequestContext context_;
scoped_ptr<WebSocketChannel> channel_;
std::vector<std::string> sub_protocols_;
@@ -386,8 +369,8 @@
GURL ws_url = ws_server.GetURL(kEchoServer);
EXPECT_TRUE(ConnectAndWait(ws_url));
- const TestProxyDelegateWithProxyInfo::ResolvedProxyInfo& info =
- proxy_delegate_->resolved_proxy_info();
+ const TestNetworkDelegateWithProxyInfo::ResolvedProxyInfo& info =
+ network_delegate_->resolved_proxy_info();
EXPECT_EQ(ws_url, info.url);
EXPECT_TRUE(info.proxy_info.is_http());
}
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698