| 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 5b9e6107dbfa615e8749a7f2a68c8a3bd19a0a47..6ca77a5015dfee2fd80aa516ea1922407d2d6154 100644
|
| --- a/net/base/layered_network_delegate_unittest.cc
|
| +++ b/net/base/layered_network_delegate_unittest.cc
|
| @@ -20,6 +20,7 @@
|
| #include "net/http/http_response_headers.h"
|
| #include "net/proxy/proxy_config_service.h"
|
| #include "net/proxy/proxy_info.h"
|
| +#include "net/proxy/proxy_service.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_test_util.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -43,6 +44,17 @@
|
| 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,
|
| @@ -179,9 +191,13 @@
|
| 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());
|
| @@ -213,6 +229,20 @@
|
| 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 {
|
|
|