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

Unified Diff: net/url_request/url_request_test_util.cc

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
Index: net/url_request/url_request_test_util.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index 5388b4978a5c66cfae615dbfb3b34c7fe30a8f9e..822cecc8768e0099c5255de9070f6521750c8cd9 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -528,3 +528,31 @@ ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
return value_;
}
+
+TestJobInterceptor::TestJobInterceptor() : main_intercept_job_(NULL) {
+}
+
+net::URLRequestJob* TestJobInterceptor::MaybeIntercept(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const {
+ net::URLRequestJob* job = main_intercept_job_;
+ main_intercept_job_ = NULL;
+ return job;
+}
+
+net::URLRequestJob* TestJobInterceptor::MaybeInterceptRedirect(
+ const GURL& location,
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const {
+ return NULL;
+}
+
+net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse(
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const {
+ return NULL;
+}
+
+void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) {
+ main_intercept_job_ = job;
+}

Powered by Google App Engine
This is Rietveld 408576698