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

Unified Diff: net/base/layered_network_delegate_unittest.cc

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (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
Index: net/base/layered_network_delegate_unittest.cc
diff --git a/net/base/layered_network_delegate_unittest.cc b/net/base/layered_network_delegate_unittest.cc
index 6ca77a5015dfee2fd80aa516ea1922407d2d6154..532b89fa733fc8a1d54250f3192d11efc64d70af 100644
--- a/net/base/layered_network_delegate_unittest.cc
+++ b/net/base/layered_network_delegate_unittest.cc
@@ -39,31 +39,20 @@ class TestNetworkDelegateImpl : public NetworkDelegateImpl {
~TestNetworkDelegateImpl() override {}
// NetworkDelegateImpl implementation:
int OnBeforeURLRequest(URLRequest* request,
const CompletionCallback& callback,
GURL* new_url) override {
IncrementAndCompareCounter("on_before_url_request_count");
return OK;
}
- void OnResolveProxy(const GURL& url,
- int load_flags,
- const ProxyService& proxy_service,
- ProxyInfo* result) override {
- IncrementAndCompareCounter("on_resolve_proxy_count");
- }
-
- void OnProxyFallback(const ProxyServer& bad_proxy, int net_error) override {
- IncrementAndCompareCounter("on_proxy_fallback_count");
- }
-
int OnBeforeSendHeaders(URLRequest* request,
const CompletionCallback& callback,
HttpRequestHeaders* headers) override {
IncrementAndCompareCounter("on_before_send_headers_count");
return OK;
}
void OnBeforeSendProxyHeaders(URLRequest* request,
const ProxyInfo& proxy_info,
HttpRequestHeaders* headers) override {
@@ -184,27 +173,23 @@ class TestLayeredNetworkDelegate : public LayeredNetworkDelegate {
~TestLayeredNetworkDelegate() override {}
void CallAndVerify() {
scoped_refptr<AuthChallengeInfo> auth_challenge(new AuthChallengeInfo());
scoped_ptr<URLRequest> request =
context_.CreateRequest(GURL(), IDLE, &delegate_);
scoped_ptr<HttpRequestHeaders> request_headers(new HttpRequestHeaders());
scoped_refptr<HttpResponseHeaders> response_headers(
new HttpResponseHeaders(""));
TestCompletionCallback completion_callback;
- scoped_ptr<ProxyService> proxy_service(ProxyService::CreateDirect());
- scoped_ptr<ProxyInfo> proxy_info(new ProxyInfo());
EXPECT_EQ(OK, OnBeforeURLRequest(request.get(),
completion_callback.callback(), NULL));
- OnResolveProxy(GURL(), 0, *proxy_service, proxy_info.get());
- OnProxyFallback(ProxyServer(), 0);
EXPECT_EQ(OK, OnBeforeSendHeaders(NULL, completion_callback.callback(),
request_headers.get()));
OnBeforeSendProxyHeaders(NULL, ProxyInfo(), request_headers.get());
OnSendHeaders(NULL, *request_headers);
OnNetworkBytesSent(request.get(), 42);
EXPECT_EQ(OK, OnHeadersReceived(NULL, completion_callback.callback(),
response_headers.get(), NULL, NULL));
OnResponseStarted(request.get());
OnNetworkBytesReceived(request.get(), 42);
OnCompleted(request.get(), false);
@@ -222,34 +207,20 @@ class TestLayeredNetworkDelegate : public LayeredNetworkDelegate {
}
protected:
void OnBeforeURLRequestInternal(URLRequest* request,
const CompletionCallback& callback,
GURL* new_url) override {
++(*counters_)["on_before_url_request_count"];
EXPECT_EQ(1, (*counters_)["on_before_url_request_count"]);
}
- void OnResolveProxyInternal(const GURL& url,
- int load_flags,
- const ProxyService& proxy_service,
- ProxyInfo* result) override {
- ++(*counters_)["on_resolve_proxy_count"];
- EXPECT_EQ(1, (*counters_)["on_resolve_proxy_count"]);
- }
-
- void OnProxyFallbackInternal(const ProxyServer& bad_proxy,
- int net_error) override {
- ++(*counters_)["on_proxy_fallback_count"];
- EXPECT_EQ(1, (*counters_)["on_proxy_fallback_count"]);
- }
-
void OnBeforeSendHeadersInternal(URLRequest* request,
const CompletionCallback& callback,
HttpRequestHeaders* headers) override {
++(*counters_)["on_before_send_headers_count"];
EXPECT_EQ(1, (*counters_)["on_before_send_headers_count"]);
}
void OnBeforeSendProxyHeadersInternal(URLRequest* request,
const ProxyInfo& proxy_info,
HttpRequestHeaders* headers) override {

Powered by Google App Engine
This is Rietveld 408576698