summaryrefslogtreecommitdiffstats
path: root/net/base/cert_database_nss_unittest.cc
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-04 22:51:20 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-04 22:51:20 +0000
commit8d80ef42bd2aeb75fa202c0575b7150ebe9421ac (patch)
treef271f806831d99ca527e0eef0a762d88c0639e85 /net/base/cert_database_nss_unittest.cc
parent57b839a8f8252d5a92695bbb7aef90acd911ee2f (diff)
downloadchromium_src-8d80ef42bd2aeb75fa202c0575b7150ebe9421ac.zip
chromium_src-8d80ef42bd2aeb75fa202c0575b7150ebe9421ac.tar.gz
chromium_src-8d80ef42bd2aeb75fa202c0575b7150ebe9421ac.tar.bz2
CertDatabase: Add GetCertTrust method.
BUG=19991 TEST=net_unittests Review URL: http://codereview.chromium.org/3614001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/cert_database_nss_unittest.cc')
-rw-r--r--net/base/cert_database_nss_unittest.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/base/cert_database_nss_unittest.cc b/net/base/cert_database_nss_unittest.cc
index b115ac0..40754d8 100644
--- a/net/base/cert_database_nss_unittest.cc
+++ b/net/base/cert_database_nss_unittest.cc
@@ -197,6 +197,9 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_SSLTrust) {
scoped_refptr<X509Certificate> cert(cert_list[0]);
EXPECT_EQ("Test CA", cert->subject().common_name);
+ EXPECT_EQ(CertDatabase::TRUSTED_SSL,
+ cert_db_.GetCertTrust(cert.get(), CA_CERT));
+
psm::nsNSSCertTrust trust(cert->os_cert_handle()->trust);
EXPECT_TRUE(trust.HasTrustedCA(PR_TRUE, PR_FALSE, PR_FALSE));
EXPECT_FALSE(trust.HasTrustedCA(PR_FALSE, PR_TRUE, PR_FALSE));
@@ -226,6 +229,9 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_EmailTrust) {
scoped_refptr<X509Certificate> cert(cert_list[0]);
EXPECT_EQ("Test CA", cert->subject().common_name);
+ EXPECT_EQ(CertDatabase::TRUSTED_EMAIL,
+ cert_db_.GetCertTrust(cert.get(), CA_CERT));
+
psm::nsNSSCertTrust trust(cert->os_cert_handle()->trust);
EXPECT_FALSE(trust.HasTrustedCA(PR_TRUE, PR_FALSE, PR_FALSE));
EXPECT_TRUE(trust.HasTrustedCA(PR_FALSE, PR_TRUE, PR_FALSE));
@@ -254,6 +260,9 @@ TEST_F(CertDatabaseNSSTest, ImportCACert_ObjSignTrust) {
scoped_refptr<X509Certificate> cert(cert_list[0]);
EXPECT_EQ("Test CA", cert->subject().common_name);
+ EXPECT_EQ(CertDatabase::TRUSTED_OBJ_SIGN,
+ cert_db_.GetCertTrust(cert.get(), CA_CERT));
+
psm::nsNSSCertTrust trust(cert->os_cert_handle()->trust);
EXPECT_FALSE(trust.HasTrustedCA(PR_TRUE, PR_FALSE, PR_FALSE));
EXPECT_FALSE(trust.HasTrustedCA(PR_FALSE, PR_TRUE, PR_FALSE));