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

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

Issue 1100003006: Certificate Transparency: Fetching of Signed Tree Heads (DRAFT) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/multi_log_ct_verifier.h" 5 #include "net/cert/multi_log_ct_verifier.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 21 matching lines...) Expand all
32 namespace { 32 namespace {
33 33
34 const char kLogDescription[] = "somelog"; 34 const char kLogDescription[] = "somelog";
35 const char kSCTCountHistogram[] = 35 const char kSCTCountHistogram[] =
36 "Net.CertificateTransparency.SCTsPerConnection"; 36 "Net.CertificateTransparency.SCTsPerConnection";
37 37
38 class MultiLogCTVerifierTest : public ::testing::Test { 38 class MultiLogCTVerifierTest : public ::testing::Test {
39 public: 39 public:
40 void SetUp() override { 40 void SetUp() override {
41 scoped_ptr<CTLogVerifier> log( 41 scoped_ptr<CTLogVerifier> log(
42 CTLogVerifier::Create(ct::GetTestPublicKey(), kLogDescription)); 42 CTLogVerifier::Create(ct::GetTestPublicKey(), kLogDescription, ""));
Ryan Sleevi 2015/04/24 10:42:08 s/""/std::string()
Eran Messeri 2015/06/18 15:18:43 Done.
43 ASSERT_TRUE(log); 43 ASSERT_TRUE(log);
44 44
45 verifier_.reset(new MultiLogCTVerifier()); 45 verifier_.reset(new MultiLogCTVerifier());
46 verifier_->AddLog(log.Pass()); 46 verifier_->AddLog(log.Pass());
47 std::string der_test_cert(ct::GetDerEncodedX509Cert()); 47 std::string der_test_cert(ct::GetDerEncodedX509Cert());
48 chain_ = X509Certificate::CreateFromBytes( 48 chain_ = X509Certificate::CreateFromBytes(
49 der_test_cert.data(), 49 der_test_cert.data(),
50 der_test_cert.length()); 50 der_test_cert.length());
51 ASSERT_TRUE(chain_.get()); 51 ASSERT_TRUE(chain_.get());
52 52
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 TEST_F(MultiLogCTVerifierTest, CountsZeroSCTsCorrectly) { 294 TEST_F(MultiLogCTVerifierTest, CountsZeroSCTsCorrectly) {
295 int connections_without_scts = GetValueFromHistogram(kSCTCountHistogram, 0); 295 int connections_without_scts = GetValueFromHistogram(kSCTCountHistogram, 0);
296 EXPECT_FALSE(VerifySinglePrecertificateChain(chain_)); 296 EXPECT_FALSE(VerifySinglePrecertificateChain(chain_));
297 ASSERT_EQ(connections_without_scts + 1, 297 ASSERT_EQ(connections_without_scts + 1,
298 GetValueFromHistogram(kSCTCountHistogram, 0)); 298 GetValueFromHistogram(kSCTCountHistogram, 0));
299 } 299 }
300 300
301 } // namespace 301 } // namespace
302 302
303 } // namespace net 303 } // namespace net
OLDNEW
« net/cert/ct_verifier.h ('K') | « net/cert/multi_log_ct_verifier.cc ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698