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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 11293252: Change Interceptors into URLRequestJobFactory::ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 5486a9015de0e0fb808a6951814ac7ecaad10faa..4c85ff5c4c2bb84ee02c5fc437ff72e886c5ea65 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -54,6 +54,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/test/test_server.h"
#include "net/url_request/ftp_protocol_handler.h"
+#include "net/url_request/protocol_intercept_job_factory.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_file_dir_job.h"
@@ -464,18 +465,22 @@ class URLRequestTest : public PlatformTest {
default_context_.set_network_delegate(&default_network_delegate_);
default_context_.Init();
}
+ virtual ~URLRequestTest() {}
// Adds the TestJobInterceptor to the default context.
TestJobInterceptor* AddTestInterceptor() {
- TestJobInterceptor* interceptor = new TestJobInterceptor();
- default_context_.set_job_factory(&job_factory_);
- job_factory_.AddInterceptor(interceptor);
- return interceptor;
+ TestJobInterceptor* protocol_handler_ = new TestJobInterceptor();
+ job_factory_.reset(new URLRequestJobFactoryImpl);
erikwright (departed) 2012/11/27 05:54:05 I assume this wrapped factory exists because someo
pauljensen 2012/11/30 21:02:34 Nobody adds protocol handlers later and job_factor
+ job_factory_.reset(new ProtocolInterceptJobFactory(job_factory_.Pass(),
+ "http",
+ protocol_handler_));
+ default_context_.set_job_factory(job_factory_.get());
+ return protocol_handler_;
}
protected:
TestNetworkDelegate default_network_delegate_; // must outlive URLRequest
- URLRequestJobFactoryImpl job_factory_;
+ scoped_ptr<URLRequestJobFactory> job_factory_;
TestURLRequestContext default_context_;
};
« net/url_request/url_request_filter.h ('K') | « net/url_request/url_request_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698