diff options
author | pauljensen@chromium.org <pauljensen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 17:04:23 +0000 |
---|---|---|
committer | pauljensen@chromium.org <pauljensen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 17:04:23 +0000 |
commit | f53b48075849f4f7d7e13002176cb861c885ab52 (patch) | |
tree | cc3429420ba40da37ffc7adad0ad63ce65fc42d5 /net/proxy | |
parent | 4e4a42657994b3752962232ef8746d3f4ac70931 (diff) | |
download | chromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.zip chromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.tar.gz chromium_src-f53b48075849f4f7d7e13002176cb861c885ab52.tar.bz2 |
Convert trivial URLRequest::Interceptors and URLRequestJobFactory::Interceptor into URLRequestJobFactory::ProtocolHandlers.
BUG=161524
Review URL: https://codereview.chromium.org/11293252
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r-- | net/proxy/proxy_script_fetcher_impl_unittest.cc | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc index a061bea..5f9990f 100644 --- a/net/proxy/proxy_script_fetcher_impl_unittest.cc +++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc @@ -44,30 +44,6 @@ struct FetchResult { string16 text; }; -// CheckNoRevocationFlagSetInterceptor causes a test failure if a request is -// seen that doesn't set a load flag to bypass revocation checking. -class CheckNoRevocationFlagSetInterceptor : - public URLRequestJobFactory::Interceptor { - public: - virtual URLRequestJob* MaybeIntercept( - URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE { - EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING); - return NULL; - } - - virtual URLRequestJob* MaybeInterceptRedirect( - const GURL& location, - URLRequest* request, - NetworkDelegate* network_delegate) const OVERRIDE { - return NULL; - } - - virtual URLRequestJob* MaybeInterceptResponse( - URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE { - return NULL; - } -}; - // A non-mock URL request which can access http:// and file:// urls. class RequestContext : public URLRequestContext { public: @@ -90,10 +66,7 @@ class RequestContext : public URLRequestContext { storage_.set_http_transaction_factory(new HttpCache( network_session, HttpCache::DefaultBackend::InMemory(0))); - scoped_ptr<URLRequestJobFactoryImpl> factory(new URLRequestJobFactoryImpl); - factory->AddInterceptor(new CheckNoRevocationFlagSetInterceptor); - url_request_job_factory_ = factory.Pass(); - set_job_factory(url_request_job_factory_.get()); + set_job_factory(new URLRequestJobFactoryImpl()); } virtual ~RequestContext() { @@ -116,7 +89,9 @@ GURL GetTestFileUrl(const std::string& relpath) { } // Really simple NetworkDelegate so we can allow local file access on ChromeOS -// without introducing layering violations. +// without introducing layering violations. Also causes a test failure if a +// request is seen that doesn't set a load flag to bypass revocation checking. + class BasicNetworkDelegate : public NetworkDelegate { public: BasicNetworkDelegate() {} @@ -126,6 +101,7 @@ class BasicNetworkDelegate : public NetworkDelegate { virtual int OnBeforeURLRequest(URLRequest* request, const CompletionCallback& callback, GURL* new_url) OVERRIDE { + EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING); return OK; } |