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

Unified Diff: net/url_request/url_request_test_util.h

Issue 10919317: Move TestJobInterceptor to url_request_test_util. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix typo Created 8 years, 3 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 | « no previous file | 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 a31788866501ba647688fcbe73381bd8fe1ce8da..1fc9f78960724af91760094b15f8ca3ee5c5864a 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -37,6 +37,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_context_storage.h"
+#include "net/url_request/url_request_job_factory.h"
using base::TimeDelta;
@@ -296,4 +297,27 @@ class ScopedCustomUrlRequestTestHttpHost {
DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost);
};
+//-----------------------------------------------------------------------------
+
+// A simple Interceptor that returns a pre-built URLRequestJob one time.
wtc 2012/09/17 22:52:03 Nit: this comment is a little hard to understand.
+class TestJobInterceptor : public net::URLRequestJobFactory::Interceptor {
+ public:
+ TestJobInterceptor();
+
+ virtual net::URLRequestJob* MaybeIntercept(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
+ virtual net::URLRequestJob* MaybeInterceptRedirect(
+ const GURL& location,
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
+ virtual net::URLRequestJob* MaybeInterceptResponse(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
+ void set_main_intercept_job(net::URLRequestJob* job);
+
+ private:
+ mutable net::URLRequestJob* main_intercept_job_;
+};
+
#endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
« no previous file with comments | « no previous file | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698