Chromium Code Reviews| 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_ |