| 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/crypto/scoped_nss_types.h" | 10 #include "base/crypto/scoped_nss_types.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 class CertDatabaseNSSTest : public testing::Test { | 105 class CertDatabaseNSSTest : public testing::Test { |
| 106 public: | 106 public: |
| 107 virtual void SetUp() { | 107 virtual void SetUp() { |
| 108 if (!temp_db_initialized_) { | 108 if (!temp_db_initialized_) { |
| 109 ASSERT_TRUE(temp_db_dir_.Get().CreateUniqueTempDir()); | 109 ASSERT_TRUE(temp_db_dir_.Get().CreateUniqueTempDir()); |
| 110 ASSERT_TRUE( | 110 ASSERT_TRUE( |
| 111 base::OpenTestNSSDB(temp_db_dir_.Get().path(), | 111 base::OpenTestNSSDB(temp_db_dir_.Get().path(), |
| 112 "CertDatabaseNSSTest db")); | 112 "CertDatabaseNSSTest db")); |
| 113 temp_db_initialized_ = true; | 113 temp_db_initialized_ = true; |
| 114 } | 114 } |
| 115 slot_ = cert_db_.GetDefaultModule(); | 115 slot_ = cert_db_.GetPublicModule(); |
| 116 | 116 |
| 117 // Test db should be empty at start of test. | 117 // Test db should be empty at start of test. |
| 118 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size()); | 118 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size()); |
| 119 } | 119 } |
| 120 virtual void TearDown() { | 120 virtual void TearDown() { |
| 121 // Don't try to cleanup if the setup failed. | 121 // Don't try to cleanup if the setup failed. |
| 122 ASSERT_TRUE(slot_->os_module_handle()); | 122 ASSERT_TRUE(slot_->os_module_handle()); |
| 123 | 123 |
| 124 EXPECT_TRUE(CleanupSlotContents(slot_->os_module_handle())); | 124 EXPECT_TRUE(CleanupSlotContents(slot_->os_module_handle())); |
| 125 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size()); | 125 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size()); |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 puny_cert.get(), CA_CERT, | 496 puny_cert.get(), CA_CERT, |
| 497 CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL)); | 497 CertDatabase::TRUSTED_SSL | CertDatabase::TRUSTED_EMAIL)); |
| 498 | 498 |
| 499 verify_result.Reset(); | 499 verify_result.Reset(); |
| 500 error = puny_cert->Verify("xn--wgv71a119e.com", flags, &verify_result); | 500 error = puny_cert->Verify("xn--wgv71a119e.com", flags, &verify_result); |
| 501 EXPECT_EQ(OK, error); | 501 EXPECT_EQ(OK, error); |
| 502 EXPECT_EQ(0, verify_result.cert_status); | 502 EXPECT_EQ(0, verify_result.cert_status); |
| 503 } | 503 } |
| 504 | 504 |
| 505 } // namespace net | 505 } // namespace net |
| OLD | NEW |