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

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: 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/net.gyp ('k') | net/url_request/protocol_intercept_job_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5f9990ffc1ba777180c82dc90a4419503a07d2bd 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;
}
« no previous file with comments | « net/net.gyp ('k') | net/url_request/protocol_intercept_job_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698