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

Unified Diff: net/base/nss_cert_database_unittest.cc

Issue 11174006: Implement ScopedTestNSSDB instead of OpenTestNSSDB() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another test Created 8 years, 2 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/nss_util.cc ('K') | « crypto/nss_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/nss_cert_database_unittest.cc
diff --git a/net/base/nss_cert_database_unittest.cc b/net/base/nss_cert_database_unittest.cc
index 2a99196cc31f24f0b07b246b5058fefd78fa5ff4..b5d5c145ffb7369605572c2a5ebfb88fa3eaaca7 100644
--- a/net/base/nss_cert_database_unittest.cc
+++ b/net/base/nss_cert_database_unittest.cc
@@ -38,20 +38,11 @@
namespace net {
-// TODO(mattm): when https://bugzilla.mozilla.org/show_bug.cgi?id=588269 is
-// fixed, switch back to using a separate userdb for each test.
-// (When doing so, remember to add some standalone tests of DeleteCert since it
-// won't be tested by TearDown anymore.)
class CertDatabaseNSSTest : public testing::Test {
public:
- static void SetUpTestCase() {
- ASSERT_TRUE(crypto::OpenTestNSSDB());
- // There is no matching TearDownTestCase call to close the test NSS DB
- // because that would leave NSS in a potentially broken state for further
- // tests, due to https://bugzilla.mozilla.org/show_bug.cgi?id=588269
- }
-
virtual void SetUp() {
+ test_nssdb_.reset(new crypto::ScopedTestNSSDB());
+ ASSERT_TRUE(test_nssdb_->is_open());
cert_db_ = NSSCertDatabase::GetInstance();
slot_ = cert_db_->GetPublicModule();
@@ -71,6 +62,8 @@ class CertDatabaseNSSTest : public testing::Test {
MessageLoop::current()->RunAllPending();
EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size());
+
+ test_nssdb_.reset();
}
protected:
@@ -129,6 +122,8 @@ class CertDatabaseNSSTest : public testing::Test {
}
return ok;
}
+
+ scoped_ptr<crypto::ScopedTestNSSDB> test_nssdb_;
Ryan Sleevi 2012/10/16 18:19:02 No need to use scoped_ptr here
Takashi Toyoshima 2012/10/17 04:58:53 Done.
};
TEST_F(CertDatabaseNSSTest, ListCerts) {
« crypto/nss_util.cc ('K') | « crypto/nss_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698