Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2185)

Unified Diff: net/cert/nss_cert_database_unittest.cc

Issue 401623006: Extract ScopedTestNSSDB from nss_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git cl format Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« crypto/scoped_test_nss_db.cc ('K') | « net/base/keygen_handler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/nss_cert_database_unittest.cc
diff --git a/net/cert/nss_cert_database_unittest.cc b/net/cert/nss_cert_database_unittest.cc
index 904b8b3e2e3133d6bce0150000800bf4fedd162e..fea2bfbdea8252f211748d43519b0d44b1e3780b 100644
--- a/net/cert/nss_cert_database_unittest.cc
+++ b/net/cert/nss_cert_database_unittest.cc
@@ -19,9 +19,8 @@
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "crypto/nss_util.h"
-#include "crypto/nss_util_internal.h"
#include "crypto/scoped_nss_types.h"
+#include "crypto/scoped_test_nss_db.h"
#include "net/base/crypto_module.h"
#include "net/base/net_errors.h"
#include "net/base/test_data_directory.h"
@@ -59,7 +58,7 @@ class CertDatabaseNSSTest : public testing::Test {
virtual void SetUp() {
ASSERT_TRUE(test_nssdb_.is_open());
cert_db_.reset(new NSSCertDatabase(
- crypto::ScopedPK11Slot(crypto::GetPersistentNSSKeySlot())));
+ crypto::ScopedPK11Slot(PK11_ReferenceSlot(test_nssdb_.slot()))));
// Test db should be empty at start of test.
EXPECT_EQ(0U, ListCertsInSlot().size());
@@ -97,8 +96,7 @@ class CertDatabaseNSSTest : public testing::Test {
CertificateList ListCertsInSlot() {
CertificateList result;
- CERTCertList* cert_list =
- PK11_ListCertsInSlot(cert_db_->GetPublicSlot().get());
+ CERTCertList* cert_list = PK11_ListCertsInSlot(test_nssdb_.slot());
for (CERTCertListNode* node = CERT_LIST_HEAD(cert_list);
!CERT_LIST_END(node, cert_list);
node = CERT_LIST_NEXT(node)) {
« crypto/scoped_test_nss_db.cc ('K') | « net/base/keygen_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698