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

Unified Diff: chrome/browser/history/starred_url_database_unittest.cc

Issue 6793008: Replacing base::DIR_TEMP with ScopedTempDir when appropriate. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: I obviously need a Windows test machine. Created 9 years, 8 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
Index: chrome/browser/history/starred_url_database_unittest.cc
diff --git a/chrome/browser/history/starred_url_database_unittest.cc b/chrome/browser/history/starred_url_database_unittest.cc
index 5bf0e22922d4bccb26287a5355a3a1b8a87d4fd7..70d0f778abb7710c675ce3f4e9a5139a18db85cc 100644
--- a/chrome/browser/history/starred_url_database_unittest.cc
+++ b/chrome/browser/history/starred_url_database_unittest.cc
@@ -7,6 +7,7 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/memory/scoped_temp_dir.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/starred_url_database.h"
@@ -65,8 +66,8 @@ class StarredURLDatabaseTest : public testing::Test,
private:
// Test setup.
void SetUp() {
- PathService::Get(base::DIR_TEMP, &db_file_);
- db_file_ = db_file_.AppendASCII("VisitTest.db");
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ db_file_ = temp_dir_.path().AppendASCII("VisitTest.db");
file_util::Delete(db_file_, false);
// Copy db file over that contains starred table.
@@ -86,7 +87,6 @@ class StarredURLDatabaseTest : public testing::Test,
}
void TearDown() {
db_.Close();
- file_util::Delete(db_file_, false);
}
// Provided for URL/StarredURLDatabase.
@@ -94,6 +94,7 @@ class StarredURLDatabaseTest : public testing::Test,
return db_;
}
+ ScopedTempDir temp_dir_;
FilePath db_file_;
sql::Connection db_;
};

Powered by Google App Engine
This is Rietveld 408576698