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

Side by Side Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/test/net/url_request_slow_http_job.cc ('k') | net/url_request/data_protocol_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_script_fetcher_impl.h" 5 #include "net/proxy/proxy_script_fetcher_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 struct FetchResult { 42 struct FetchResult {
43 int code; 43 int code;
44 string16 text; 44 string16 text;
45 }; 45 };
46 46
47 // CheckNoRevocationFlagSetInterceptor causes a test failure if a request is 47 // CheckNoRevocationFlagSetInterceptor causes a test failure if a request is
48 // seen that doesn't set a load flag to bypass revocation checking. 48 // seen that doesn't set a load flag to bypass revocation checking.
49 class CheckNoRevocationFlagSetInterceptor : 49 class CheckNoRevocationFlagSetInterceptor :
50 public URLRequestJobFactory::Interceptor { 50 public URLRequestJobFactory::Interceptor {
51 public: 51 public:
52 virtual URLRequestJob* MaybeIntercept(URLRequest* request) const OVERRIDE { 52 virtual URLRequestJob* MaybeIntercept(
53 URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
53 EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING); 54 EXPECT_TRUE(request->load_flags() & LOAD_DISABLE_CERT_REVOCATION_CHECKING);
54 return NULL; 55 return NULL;
55 } 56 }
56 57
57 virtual URLRequestJob* MaybeInterceptRedirect(const GURL& location, 58 virtual URLRequestJob* MaybeInterceptRedirect(
58 URLRequest* request) 59 const GURL& location,
59 const OVERRIDE { 60 URLRequest* request,
61 NetworkDelegate* network_delegate) const OVERRIDE {
60 return NULL; 62 return NULL;
61 } 63 }
62 64
63 virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request) 65 virtual URLRequestJob* MaybeInterceptResponse(
64 const OVERRIDE{ 66 URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE {
65 return NULL; 67 return NULL;
66 } 68 }
67 }; 69 };
68 70
69 // A non-mock URL request which can access http:// and file:// urls. 71 // A non-mock URL request which can access http:// and file:// urls.
70 class RequestContext : public URLRequestContext { 72 class RequestContext : public URLRequestContext {
71 public: 73 public:
72 RequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { 74 RequestContext() : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
73 ProxyConfig no_proxy; 75 ProxyConfig no_proxy;
74 storage_.set_host_resolver(new MockHostResolver); 76 storage_.set_host_resolver(new MockHostResolver);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 { 488 {
487 GURL url(kEncodedUrlBroken); 489 GURL url(kEncodedUrlBroken);
488 string16 text; 490 string16 text;
489 TestCompletionCallback callback; 491 TestCompletionCallback callback;
490 int result = pac_fetcher.Fetch(url, &text, callback.callback()); 492 int result = pac_fetcher.Fetch(url, &text, callback.callback());
491 EXPECT_EQ(ERR_FAILED, result); 493 EXPECT_EQ(ERR_FAILED, result);
492 } 494 }
493 } 495 }
494 496
495 } // namespace net 497 } // namespace net
OLDNEW
« no previous file with comments | « content/test/net/url_request_slow_http_job.cc ('k') | net/url_request/data_protocol_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698