| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/internal/cert_issuer_source_static.h" | 5 #include "net/cert/internal/cert_issuer_source_static.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "net/cert/internal/parsed_certificate.h" | 8 #include "net/cert/internal/parsed_certificate.h" |
| 9 #include "net/cert/internal/test_helpers.h" | 9 #include "net/cert/internal/test_helpers.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 ::testing::AssertionResult ReadTestCert( | 30 ::testing::AssertionResult ReadTestCert( |
| 31 const std::string& file_name, | 31 const std::string& file_name, |
| 32 scoped_refptr<ParsedCertificate>* result) { | 32 scoped_refptr<ParsedCertificate>* result) { |
| 33 std::string der; | 33 std::string der; |
| 34 ::testing::AssertionResult r = | 34 ::testing::AssertionResult r = |
| 35 ReadTestPem("net/data/cert_issuer_source_static_unittest/" + file_name, | 35 ReadTestPem("net/data/cert_issuer_source_static_unittest/" + file_name, |
| 36 "CERTIFICATE", &der); | 36 "CERTIFICATE", &der); |
| 37 if (!r) | 37 if (!r) |
| 38 return r; | 38 return r; |
| 39 *result = ParsedCertificate::CreateFromCertificateCopy(der); | 39 *result = ParsedCertificate::CreateFromCertificateCopy(der, {}); |
| 40 if (!*result) | 40 if (!*result) |
| 41 return ::testing::AssertionFailure() << "CreateFromCertificateCopy failed"; | 41 return ::testing::AssertionFailure() << "CreateFromCertificateCopy failed"; |
| 42 return ::testing::AssertionSuccess(); | 42 return ::testing::AssertionSuccess(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 class CertIssuerSourceStaticTest : public ::testing::Test { | 45 class CertIssuerSourceStaticTest : public ::testing::Test { |
| 46 public: | 46 public: |
| 47 void SetUp() override { | 47 void SetUp() override { |
| 48 ASSERT_TRUE(ReadTestCert("root.pem", &root_)); | 48 ASSERT_TRUE(ReadTestCert("root.pem", &root_)); |
| 49 ASSERT_TRUE(ReadTestCert("i1_1.pem", &i1_1_)); | 49 ASSERT_TRUE(ReadTestCert("i1_1.pem", &i1_1_)); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 CertIssuerSourceStatic source; | 132 CertIssuerSourceStatic source; |
| 133 source.AddCert(i1_1_); | 133 source.AddCert(i1_1_); |
| 134 std::unique_ptr<CertIssuerSource::Request> request; | 134 std::unique_ptr<CertIssuerSource::Request> request; |
| 135 source.AsyncGetIssuersOf(c1_.get(), base::Bind(&NotCalled), &request); | 135 source.AsyncGetIssuersOf(c1_.get(), base::Bind(&NotCalled), &request); |
| 136 EXPECT_EQ(nullptr, request); | 136 EXPECT_EQ(nullptr, request); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace | 139 } // namespace |
| 140 | 140 |
| 141 } // namespace net | 141 } // namespace net |
| OLD | NEW |