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

Unified Diff: chrome/browser/password_manager/login_database_unittest.cc

Issue 10386222: Use ScopedTempDir instead of DIR_TEST_DATA for creating test data. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/webdata/autofill_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/login_database_unittest.cc
diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc
index c879f0aae7ffa7208c458cb0ffa542d28456e867..9a288d686a6ac1a1b0aaa9be3978223777e2cfd4 100644
--- a/chrome/browser/password_manager/login_database_unittest.cc
+++ b/chrome/browser/password_manager/login_database_unittest.cc
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/scoped_temp_dir.h"
#include "base/string_number_conversions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
@@ -19,19 +20,12 @@ using webkit::forms::PasswordForm;
class LoginDatabaseTest : public testing::Test {
protected:
virtual void SetUp() {
- PathService::Get(chrome::DIR_TEST_DATA, &file_);
- const std::string test_db =
- "TestMetadataStoreMacDatabase" +
- base::Int64ToString(base::Time::Now().ToInternalValue()) + ".db";
- file_ = file_.AppendASCII(test_db);
- file_util::Delete(file_, false);
- }
-
- virtual void TearDown() {
- file_util::Delete(file_, false);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ file_ = temp_dir_.path().AppendASCII("TestMetadataStoreMacDatabase");
}
FilePath file_;
+ ScopedTempDir temp_dir_;
};
TEST_F(LoginDatabaseTest, Logins) {
« no previous file with comments | « no previous file | chrome/browser/webdata/autofill_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698