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

Unified Diff: net/base/cert_database_nss_unittest.cc

Issue 5682008: Make members of Singleton<T> private and only visible to the singleton type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
Index: net/base/cert_database_nss_unittest.cc
diff --git a/net/base/cert_database_nss_unittest.cc b/net/base/cert_database_nss_unittest.cc
index 5056e5dfbfdac1d57476b46c94c9786de268e00f..8e691041e96803ef6114349a93df174b08099f9e 100644
--- a/net/base/cert_database_nss_unittest.cc
+++ b/net/base/cert_database_nss_unittest.cc
@@ -104,16 +104,9 @@ bool ReadCertIntoList(const std::string& name, CertificateList* certs) {
class CertDatabaseNSSTest : public testing::Test {
public:
virtual void SetUp() {
- if (!temp_db_initialized_) {
- ScopedTempDir* temp_db_dir = Singleton<
- ScopedTempDir,
- DefaultSingletonTraits<ScopedTempDir>,
- CertDatabaseNSSTest>::get();
- ASSERT_TRUE(temp_db_dir->CreateUniqueTempDir());
- ASSERT_TRUE(
- base::OpenTestNSSDB(temp_db_dir->path(), "CertDatabaseNSSTest db"));
- temp_db_initialized_ = true;
- }
+ ASSERT_TRUE(temp_db_dir_.CreateUniqueTempDir());
+ ASSERT_TRUE(
+ base::OpenTestNSSDB(temp_db_dir_.path(), "CertDatabaseNSSTest db"));
slot_.reset(base::GetDefaultNSSKeySlot());
// Test db should be empty at start of test.
@@ -121,7 +114,6 @@ class CertDatabaseNSSTest : public testing::Test {
}
virtual void TearDown() {
// Don't try to cleanup if the setup failed.
- ASSERT_TRUE(temp_db_initialized_);
ASSERT_TRUE(slot_.get());
EXPECT_TRUE(CleanupSlotContents(slot_.get()));
@@ -133,12 +125,9 @@ class CertDatabaseNSSTest : public testing::Test {
CertDatabase cert_db_;
private:
- static bool temp_db_initialized_;
+ ScopedTempDir temp_db_dir_;
};
-// static
-bool CertDatabaseNSSTest::temp_db_initialized_ = false;
-
TEST_F(CertDatabaseNSSTest, ListCerts) {
// This test isn't terribly useful, though it will at least let valgrind test
// for leaks.

Powered by Google App Engine
This is Rietveld 408576698