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

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

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « net/cert/multi_threaded_cert_verifier.h ('k') | net/cookies/cookie_monster.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/cert/multi_threaded_cert_verifier.h" 5 #include "net/cert/multi_threaded_cert_verifier.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 18 matching lines...) Expand all
29 29
30 void FailTest(int /* result */) { 30 void FailTest(int /* result */) {
31 FAIL(); 31 FAIL();
32 } 32 }
33 33
34 class MockCertVerifyProc : public CertVerifyProc { 34 class MockCertVerifyProc : public CertVerifyProc {
35 public: 35 public:
36 MockCertVerifyProc() {} 36 MockCertVerifyProc() {}
37 37
38 private: 38 private:
39 virtual ~MockCertVerifyProc() {} 39 ~MockCertVerifyProc() override {}
40 40
41 // CertVerifyProc implementation 41 // CertVerifyProc implementation
42 virtual bool SupportsAdditionalTrustAnchors() const override { 42 bool SupportsAdditionalTrustAnchors() const override { return false; }
43 return false;
44 }
45 43
46 virtual int VerifyInternal(X509Certificate* cert, 44 int VerifyInternal(X509Certificate* cert,
47 const std::string& hostname, 45 const std::string& hostname,
48 int flags, 46 int flags,
49 CRLSet* crl_set, 47 CRLSet* crl_set,
50 const CertificateList& additional_trust_anchors, 48 const CertificateList& additional_trust_anchors,
51 CertVerifyResult* verify_result) override { 49 CertVerifyResult* verify_result) override {
52 verify_result->Reset(); 50 verify_result->Reset();
53 verify_result->verified_cert = cert; 51 verify_result->verified_cert = cert;
54 verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID; 52 verify_result->cert_status = CERT_STATUS_COMMON_NAME_INVALID;
55 return ERR_CERT_COMMON_NAME_INVALID; 53 return ERR_CERT_COMMON_NAME_INVALID;
56 } 54 }
57 }; 55 };
58 56
59 class MockCertTrustAnchorProvider : public CertTrustAnchorProvider { 57 class MockCertTrustAnchorProvider : public CertTrustAnchorProvider {
60 public: 58 public:
61 MockCertTrustAnchorProvider() {} 59 MockCertTrustAnchorProvider() {}
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 Mock::VerifyAndClearExpectations(&trust_provider); 474 Mock::VerifyAndClearExpectations(&trust_provider);
477 ASSERT_EQ(ERR_IO_PENDING, error); 475 ASSERT_EQ(ERR_IO_PENDING, error);
478 EXPECT_TRUE(request_handle); 476 EXPECT_TRUE(request_handle);
479 error = callback.WaitForResult(); 477 error = callback.WaitForResult();
480 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error); 478 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error);
481 ASSERT_EQ(3u, verifier_.requests()); 479 ASSERT_EQ(3u, verifier_.requests());
482 ASSERT_EQ(1u, verifier_.cache_hits()); 480 ASSERT_EQ(1u, verifier_.cache_hits());
483 } 481 }
484 482
485 } // namespace net 483 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/multi_threaded_cert_verifier.h ('k') | net/cookies/cookie_monster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698