| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ocsp/nss_ocsp.h" | 5 #include "net/ocsp/nss_ocsp.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 class AiaResponseHandler : public net::URLRequestInterceptor { | 43 class AiaResponseHandler : public net::URLRequestInterceptor { |
| 44 public: | 44 public: |
| 45 AiaResponseHandler(const std::string& headers, const std::string& cert_data) | 45 AiaResponseHandler(const std::string& headers, const std::string& cert_data) |
| 46 : headers_(headers), cert_data_(cert_data), request_count_(0) {} | 46 : headers_(headers), cert_data_(cert_data), request_count_(0) {} |
| 47 virtual ~AiaResponseHandler() {} | 47 virtual ~AiaResponseHandler() {} |
| 48 | 48 |
| 49 // net::URLRequestInterceptor implementation: | 49 // net::URLRequestInterceptor implementation: |
| 50 virtual net::URLRequestJob* MaybeInterceptRequest( | 50 virtual net::URLRequestJob* MaybeInterceptRequest( |
| 51 net::URLRequest* request, | 51 net::URLRequest* request, |
| 52 net::NetworkDelegate* network_delegate) const OVERRIDE { | 52 net::NetworkDelegate* network_delegate) const override { |
| 53 ++const_cast<AiaResponseHandler*>(this)->request_count_; | 53 ++const_cast<AiaResponseHandler*>(this)->request_count_; |
| 54 | 54 |
| 55 return new net::URLRequestTestJob( | 55 return new net::URLRequestTestJob( |
| 56 request, network_delegate, headers_, cert_data_, true); | 56 request, network_delegate, headers_, cert_data_, true); |
| 57 } | 57 } |
| 58 | 58 |
| 59 int request_count() const { return request_count_; } | 59 int request_count() const { return request_count_; } |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 std::string headers_; | 62 std::string headers_; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 error = test_callback.WaitForResult(); | 156 error = test_callback.WaitForResult(); |
| 157 | 157 |
| 158 EXPECT_EQ(OK, error); | 158 EXPECT_EQ(OK, error); |
| 159 | 159 |
| 160 // Ensure that NSS made an AIA request for the missing intermediate. | 160 // Ensure that NSS made an AIA request for the missing intermediate. |
| 161 EXPECT_LT(0, request_count()); | 161 EXPECT_LT(0, request_count()); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace net | 164 } // namespace net |
| OLD | NEW |