OLD | NEW |
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/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 { "google.pem_pkcs7.p7b", X509Certificate::FORMAT_AUTO, | 860 { "google.pem_pkcs7.p7b", X509Certificate::FORMAT_AUTO, |
861 { google_parse_fingerprint, | 861 { google_parse_fingerprint, |
862 thawte_parse_fingerprint, | 862 thawte_parse_fingerprint, |
863 NULL, } }, | 863 NULL, } }, |
864 }; | 864 }; |
865 | 865 |
866 class X509CertificateParseTest | 866 class X509CertificateParseTest |
867 : public testing::TestWithParam<CertificateFormatTestData> { | 867 : public testing::TestWithParam<CertificateFormatTestData> { |
868 public: | 868 public: |
869 virtual ~X509CertificateParseTest() {} | 869 virtual ~X509CertificateParseTest() {} |
870 virtual void SetUp() { | 870 void SetUp() override { test_data_ = GetParam(); } |
871 test_data_ = GetParam(); | 871 void TearDown() override {} |
872 } | |
873 virtual void TearDown() {} | |
874 | 872 |
875 protected: | 873 protected: |
876 CertificateFormatTestData test_data_; | 874 CertificateFormatTestData test_data_; |
877 }; | 875 }; |
878 | 876 |
879 TEST_P(X509CertificateParseTest, CanParseFormat) { | 877 TEST_P(X509CertificateParseTest, CanParseFormat) { |
880 base::FilePath certs_dir = GetTestCertsDirectory(); | 878 base::FilePath certs_dir = GetTestCertsDirectory(); |
881 CertificateList certs = CreateCertificateListFromFile( | 879 CertificateList certs = CreateCertificateListFromFile( |
882 certs_dir, test_data_.file_name, test_data_.format); | 880 certs_dir, test_data_.file_name, test_data_.format); |
883 ASSERT_FALSE(certs.empty()); | 881 ASSERT_FALSE(certs.empty()); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 &actual_type); | 1177 &actual_type); |
1180 | 1178 |
1181 EXPECT_EQ(data.expected_bits, actual_bits); | 1179 EXPECT_EQ(data.expected_bits, actual_bits); |
1182 EXPECT_EQ(data.expected_type, actual_type); | 1180 EXPECT_EQ(data.expected_type, actual_type); |
1183 } | 1181 } |
1184 | 1182 |
1185 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, | 1183 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, |
1186 testing::ValuesIn(kPublicKeyInfoTestData)); | 1184 testing::ValuesIn(kPublicKeyInfoTestData)); |
1187 | 1185 |
1188 } // namespace net | 1186 } // namespace net |
OLD | NEW |