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

Side by Side Diff: net/cert_net/nss_ocsp_unittest.cc

Issue 2602243002: Use TaskScheduler instead of WorkerPool in multi_threaded_cert_verifier.cc. (Closed)
Patch Set: self-review Created 3 years, 10 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
OLDNEW
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/cert_net/nss_ocsp.h" 5 #include "net/cert_net/nss_ocsp.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/test/scoped_async_task_scheduler.h"
15 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
16 #include "net/base/test_completion_callback.h" 17 #include "net/base/test_completion_callback.h"
17 #include "net/cert/cert_status_flags.h" 18 #include "net/cert/cert_status_flags.h"
18 #include "net/cert/cert_verifier.h" 19 #include "net/cert/cert_verifier.h"
19 #include "net/cert/cert_verify_proc.h" 20 #include "net/cert/cert_verify_proc.h"
20 #include "net/cert/cert_verify_proc_nss.h" 21 #include "net/cert/cert_verify_proc_nss.h"
21 #include "net/cert/cert_verify_result.h" 22 #include "net/cert/cert_verify_result.h"
22 #include "net/cert/multi_threaded_cert_verifier.h" 23 #include "net/cert/multi_threaded_cert_verifier.h"
23 #include "net/cert/test_root_certs.h" 24 #include "net/cert/test_root_certs.h"
24 #include "net/cert/x509_certificate.h" 25 #include "net/cert/x509_certificate.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 118 }
118 119
119 int request_count() const { 120 int request_count() const {
120 return handler_->request_count(); 121 return handler_->request_count();
121 } 122 }
122 123
123 protected: 124 protected:
124 const CertificateList empty_cert_list_; 125 const CertificateList empty_cert_list_;
125 126
126 private: 127 private:
128 // Required by MultiThreadedCertVerifier. Needs to be a
Ryan Sleevi 2017/02/07 22:52:09 This seems to be an undesirable coupling. It also
129 // ScopedAsyncTaskScheduler rather than a ScopedTaskScheduler because the task
130 // posted by MultiThreadedCertVerifier synchronously waits for a task running
131 // on the main thread (OCSPRequestSession::Wait).
132 base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_;
127 TestURLRequestContext context_; 133 TestURLRequestContext context_;
128 AiaResponseHandler* handler_; 134 AiaResponseHandler* handler_;
129 scoped_refptr<CertVerifyProc> verify_proc_; 135 scoped_refptr<CertVerifyProc> verify_proc_;
130 std::unique_ptr<CertVerifier> verifier_; 136 std::unique_ptr<CertVerifier> verifier_;
131 }; 137 };
132 138
133 // Tests that when using NSS to verify certificates, and IO is enabled, 139 // Tests that when using NSS to verify certificates, and IO is enabled,
134 // that a request to fetch missing intermediate certificates is 140 // that a request to fetch missing intermediate certificates is
135 // made successfully. 141 // made successfully.
136 TEST_F(NssHttpTest, TestAia) { 142 TEST_F(NssHttpTest, TestAia) {
(...skipping 21 matching lines...) Expand all
158 164
159 error = test_callback.WaitForResult(); 165 error = test_callback.WaitForResult();
160 166
161 EXPECT_THAT(error, IsOk()); 167 EXPECT_THAT(error, IsOk());
162 168
163 // Ensure that NSS made an AIA request for the missing intermediate. 169 // Ensure that NSS made an AIA request for the missing intermediate.
164 EXPECT_LT(0, request_count()); 170 EXPECT_LT(0, request_count());
165 } 171 }
166 172
167 } // namespace net 173 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698