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

Unified Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 11293252: Change Interceptors into URLRequestJobFactory::ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PolicyTests to unregister with URLRequestFilter 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
Index: net/proxy/proxy_script_fetcher_impl_unittest.cc
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index a061beaffd07a3f97aae61ebb5d64a1075754f24..ad593ad40664bd9fed963d9ae4ee564e5ed082b6 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -21,6 +21,7 @@
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_impl.h"
#include "net/test/test_server.h"
+#include "net/url_request/protocol_intercept_job_factory.h"
#include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_file_job.h"
#include "net/url_request/url_request_job_factory_impl.h"
@@ -47,25 +48,13 @@ struct FetchResult {
// 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 URLRequestJobFactory::ProtocolHandler {
public:
- virtual URLRequestJob* MaybeIntercept(
+ virtual URLRequestJob* MaybeCreateJob(
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.
@@ -90,9 +79,11 @@ 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();
+ url_request_job_factory_.reset(new URLRequestJobFactoryImpl);
+ url_request_job_factory_.reset(new ProtocolInterceptJobFactory(
+ url_request_job_factory_.Pass(),
+ NULL,
+ new CheckNoRevocationFlagSetInterceptor()));
set_job_factory(url_request_job_factory_.get());
}

Powered by Google App Engine
This is Rietveld 408576698