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

Side by Side Diff: net/base/multi_threaded_cert_verifier_unittest.cc

Issue 10917309: Make MultiThreadedCertVerifier receive a CertVerifyProc, rather than creating one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « net/base/multi_threaded_cert_verifier.cc ('k') | no next file » | 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/base/multi_threaded_cert_verifier.h" 5 #include "net/base/multi_threaded_cert_verifier.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 verify_result->verified_cert = cert; 42 verify_result->verified_cert = cert;
43 verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID; 43 verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID;
44 return ERR_CERT_COMMON_NAME_INVALID; 44 return ERR_CERT_COMMON_NAME_INVALID;
45 } 45 }
46 }; 46 };
47 47
48 } // namespace 48 } // namespace
49 49
50 class MultiThreadedCertVerifierTest : public ::testing::Test { 50 class MultiThreadedCertVerifierTest : public ::testing::Test {
51 public: 51 public:
52 MultiThreadedCertVerifierTest() { 52 MultiThreadedCertVerifierTest() : verifier_(new MockCertVerifyProc()) {}
wtc 2012/09/18 02:51:55 This is good. The original code required us to cre
53 verifier_.SetCertVerifyProc(new MockCertVerifyProc());
54 }
55 virtual ~MultiThreadedCertVerifierTest() {} 53 virtual ~MultiThreadedCertVerifierTest() {}
56 54
57 protected: 55 protected:
58 MultiThreadedCertVerifier verifier_; 56 MultiThreadedCertVerifier verifier_;
59 }; 57 };
60 58
61 TEST_F(MultiThreadedCertVerifierTest, CacheHit) { 59 TEST_F(MultiThreadedCertVerifierTest, CacheHit) {
62 FilePath certs_dir = GetTestCertsDirectory(); 60 FilePath certs_dir = GetTestCertsDirectory();
63 scoped_refptr<X509Certificate> test_cert( 61 scoped_refptr<X509Certificate> test_cert(
64 ImportCertFromFile(certs_dir, "ok_cert.pem")); 62 ImportCertFromFile(certs_dir, "ok_cert.pem"));
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 EXPECT_FALSE(key1 < key2); 317 EXPECT_FALSE(key1 < key2);
320 EXPECT_TRUE(key2 < key1); 318 EXPECT_TRUE(key2 < key1);
321 break; 319 break;
322 default: 320 default:
323 FAIL() << "Invalid expectation. Can be only -1, 0, 1"; 321 FAIL() << "Invalid expectation. Can be only -1, 0, 1";
324 } 322 }
325 } 323 }
326 } 324 }
327 325
328 } // namespace net 326 } // namespace net
OLDNEW
« no previous file with comments | « net/base/multi_threaded_cert_verifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698