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

Unified Diff: net/url_request/url_request_test_util.h

Issue 6541021: Send fatal proxy errors to the network delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 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_job.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.h
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index 3f8b4b483dfd1fc1771f6155abe18f744d717327..394b3272369826d67004c458afb54ed133d06b7b 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -28,6 +28,7 @@
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_cache.h"
+#include "net/http/http_network_delegate.h"
#include "net/http/http_network_layer.h"
#include "net/test/test_server.h"
#include "net/url_request/url_request.h"
@@ -75,6 +76,8 @@ class TestURLRequestContext : public net::URLRequestContext {
public:
TestURLRequestContext();
explicit TestURLRequestContext(const std::string& proxy);
+ TestURLRequestContext(const std::string& proxy,
+ net::HostResolver* host_resolver);
protected:
virtual ~TestURLRequestContext();
@@ -183,4 +186,25 @@ class TestDelegate : public net::URLRequest::Delegate {
scoped_refptr<net::IOBuffer> buf_;
};
+//-----------------------------------------------------------------------------
+
+class TestHttpNetworkDelegate : public net::HttpNetworkDelegate {
+ public:
+ TestHttpNetworkDelegate();
+ virtual ~TestHttpNetworkDelegate();
+
+ // net::HttpNetworkDelegate:
+ virtual void OnBeforeURLRequest(net::URLRequest* request);
+ virtual void OnSendHttpRequest(net::HttpRequestHeaders* headers);
+ virtual void OnResponseStarted(net::URLRequest* request);
+ virtual void OnReadCompleted(net::URLRequest* request, int bytes_read);
+
+ int last_os_error() const { return last_os_error_; }
+ int error_count() const { return error_count_; }
+
+ private:
+ int last_os_error_;
+ int error_count_;
+};
+
#endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
« no previous file with comments | « net/url_request/url_request_job.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698