OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cert.h> | 5 #include <cert.h> |
6 #include <pk11pub.h> | 6 #include <pk11pub.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 if (!cert_db.DeleteCertAndKey(certs[i])) | 126 if (!cert_db.DeleteCertAndKey(certs[i])) |
127 ok = false; | 127 ok = false; |
128 } | 128 } |
129 return ok; | 129 return ok; |
130 } | 130 } |
131 | 131 |
132 static base::LazyInstance<ScopedTempDir> temp_db_dir_; | 132 static base::LazyInstance<ScopedTempDir> temp_db_dir_; |
133 }; | 133 }; |
134 | 134 |
135 // static | 135 // static |
136 base::LazyInstance<ScopedTempDir> CertDatabaseNSSTest::temp_db_dir_( | 136 base::LazyInstance<ScopedTempDir> CertDatabaseNSSTest::temp_db_dir_ = |
137 base::LINKER_INITIALIZED); | 137 LAZY_INSTANCE_INITIALIZER; |
138 | 138 |
139 TEST_F(CertDatabaseNSSTest, ListCerts) { | 139 TEST_F(CertDatabaseNSSTest, ListCerts) { |
140 // This test isn't terribly useful, though it will at least let valgrind test | 140 // This test isn't terribly useful, though it will at least let valgrind test |
141 // for leaks. | 141 // for leaks. |
142 CertificateList certs; | 142 CertificateList certs; |
143 cert_db_.ListCerts(&certs); | 143 cert_db_.ListCerts(&certs); |
144 // The test DB is empty, but let's assume there will always be something in | 144 // The test DB is empty, but let's assume there will always be something in |
145 // the other slots. | 145 // the other slots. |
146 EXPECT_LT(0U, certs.size()); | 146 EXPECT_LT(0U, certs.size()); |
147 } | 147 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 puny_cert.get(), CA_CERT, | 576 puny_cert.get(), CA_CERT, |
577 CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL)); | 577 CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL)); |
578 | 578 |
579 verify_result.Reset(); | 579 verify_result.Reset(); |
580 error = puny_cert->Verify("xn--wgv71a119e.com", flags, NULL, &verify_result); | 580 error = puny_cert->Verify("xn--wgv71a119e.com", flags, NULL, &verify_result); |
581 EXPECT_EQ(OK, error); | 581 EXPECT_EQ(OK, error); |
582 EXPECT_EQ(0U, verify_result.cert_status); | 582 EXPECT_EQ(0U, verify_result.cert_status); |
583 } | 583 } |
584 | 584 |
585 } // namespace net | 585 } // namespace net |
OLD | NEW |