summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 04:37:51 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 04:37:51 +0000
commit0274629c9983144bc161bb88a7e9436d28301e6d (patch)
treeb66495bbb20df46562644fe5587254b313036c63 /chrome/browser/chromeos
parent527516c019a53b8417b3e4ba3612083efe4e29ce (diff)
downloadchromium_src-0274629c9983144bc161bb88a7e9436d28301e6d.zip
chromium_src-0274629c9983144bc161bb88a7e9436d28301e6d.tar.gz
chromium_src-0274629c9983144bc161bb88a7e9436d28301e6d.tar.bz2
CertDatabaseNSSTest: Don't delete test DB dir since we don't close the DB (broke in r108543).
Refactor test DB code so that nss_util owns the test DB dir. Keeping the test DB dir until exit prevents later tests that would use the test DB from failing. The dir will still be deleted by the LazyInstance atexit handler. BUG=108748 TEST=see bug Review URL: http://codereview.chromium.org/9255034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119003 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/cros/onc_network_parser_unittest.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc
index bc77fd3..2c637f1 100644
--- a/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc
+++ b/chrome/browser/chromeos/cros/onc_network_parser_unittest.cc
@@ -12,7 +12,6 @@
#include "base/json/json_value_serializer.h"
#include "base/lazy_instance.h"
#include "base/path_service.h"
-#include "base/scoped_temp_dir.h"
#include "base/threading/thread_restrictions.h"
#include "base/stringprintf.h"
#include "base/values.h"
@@ -56,18 +55,15 @@ net::CertType GetCertType(const net::X509Certificate* cert) {
class OncNetworkParserTest : public testing::Test {
public:
static void SetUpTestCase() {
- ASSERT_TRUE(temp_db_dir_.Get().CreateUniqueTempDir());
// Ideally, we'd open a test DB for each test case, and close it
// again, removing the temp dir, but unfortunately, there's a
// bug in NSS that prevents this from working, so we just open
// it once, and empty it for each test case. Here's the bug:
// https://bugzilla.mozilla.org/show_bug.cgi?id=588269
- ASSERT_TRUE(
- crypto::OpenTestNSSDB(temp_db_dir_.Get().path(), g_token_name));
- }
-
- static void TearDownTestCase() {
- ASSERT_TRUE(temp_db_dir_.Get().Delete());
+ 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() {
@@ -141,7 +137,6 @@ class OncNetworkParserTest : public testing::Test {
return ok;
}
- static base::LazyInstance<ScopedTempDir> temp_db_dir_;
ScopedStubCrosEnabler stub_cros_enabler_;
};
@@ -207,10 +202,6 @@ void OncNetworkParserTest::TestProxySettings(const std::string test_blob,
net_config));
}
-// static
-base::LazyInstance<ScopedTempDir> OncNetworkParserTest::temp_db_dir_ =
- LAZY_INSTANCE_INITIALIZER;
-
TEST_F(OncNetworkParserTest, TestCreateNetworkWifi) {
std::string test_blob;
GetTestData("network-wifi.onc", &test_blob);