| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |