Chromium Code Reviews| 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 38eee92062f1c158f08569f755481fabd6d34486..f15282d4ccca59f038e0a1b0adcb5c54c55b7198 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/12/06 15:26:28
Is there a reason why this should be a ProtocolInt
pauljensen
2012/12/07 18:47:42
TestJobInterceptor only intercepts the first HTTP
erikwright (departed)
2012/12/07 20:12:05
OK, I see.
pauljensen
2012/12/09 23:14:12
For now they must pass things like SetProtocolHand
|
| + 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_; |
| }; |