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

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: sync Created 8 years 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 | « net/url_request/url_request_test_util.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 611f04dd17d34f4853c8e2309cd76db811503bf4..977c6168225d8928a3e996d8d4fdcae7227ad95b 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -466,18 +466,20 @@ 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);
+ job_factory_->SetProtocolHandler("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<URLRequestJobFactoryImpl> job_factory_;
TestURLRequestContext default_context_;
};
« no previous file with comments | « net/url_request/url_request_test_util.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698