| 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 <cert.h> | 5 #include <cert.h> |
| 6 #include <certdb.h> | 6 #include <certdb.h> |
| 7 #include <pk11pub.h> | 7 #include <pk11pub.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "net/test/cert_test_util.h" | 30 #include "net/test/cert_test_util.h" |
| 31 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" | 31 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
| 33 | 33 |
| 34 // In NSS 3.13, CERTDB_VALID_PEER was renamed CERTDB_TERMINAL_RECORD. So we use | 34 // In NSS 3.13, CERTDB_VALID_PEER was renamed CERTDB_TERMINAL_RECORD. So we use |
| 35 // the new name of the macro. | 35 // the new name of the macro. |
| 36 #if !defined(CERTDB_TERMINAL_RECORD) | 36 #if !defined(CERTDB_TERMINAL_RECORD) |
| 37 #define CERTDB_TERMINAL_RECORD CERTDB_VALID_PEER | 37 #define CERTDB_TERMINAL_RECORD CERTDB_VALID_PEER |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 using base::ASCIIToUTF16; |
| 41 |
| 40 namespace net { | 42 namespace net { |
| 41 | 43 |
| 42 class CertDatabaseNSSTest : public testing::Test { | 44 class CertDatabaseNSSTest : public testing::Test { |
| 43 public: | 45 public: |
| 44 virtual void SetUp() { | 46 virtual void SetUp() { |
| 45 ASSERT_TRUE(test_nssdb_.is_open()); | 47 ASSERT_TRUE(test_nssdb_.is_open()); |
| 46 cert_db_ = NSSCertDatabase::GetInstance(); | 48 cert_db_ = NSSCertDatabase::GetInstance(); |
| 47 slot_ = cert_db_->GetPublicModule(); | 49 slot_ = cert_db_->GetPublicModule(); |
| 48 | 50 |
| 49 // Test db should be empty at start of test. | 51 // Test db should be empty at start of test. |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT, | 1035 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT, |
| 1034 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT)); | 1036 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT)); |
| 1035 | 1037 |
| 1036 new_certs = ListCertsInSlot(slot_->os_module_handle()); | 1038 new_certs = ListCertsInSlot(slot_->os_module_handle()); |
| 1037 ASSERT_EQ(2U, new_certs.size()); | 1039 ASSERT_EQ(2U, new_certs.size()); |
| 1038 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname, | 1040 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname, |
| 1039 new_certs[1]->os_cert_handle()->nickname); | 1041 new_certs[1]->os_cert_handle()->nickname); |
| 1040 } | 1042 } |
| 1041 | 1043 |
| 1042 } // namespace net | 1044 } // namespace net |
| OLD | NEW |