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

Unified Diff: chrome/browser/webdata/autofill_table_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
Index: chrome/browser/webdata/autofill_table_unittest.cc
diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc
index 337da0bc0dd8719c3c4113c8182c106fbe85962a..bdff3c5aea15ffef08ac45645c11163c3eb9be3f 100644
--- a/chrome/browser/webdata/autofill_table_unittest.cc
+++ b/chrome/browser/webdata/autofill_table_unittest.cc
@@ -6,6 +6,7 @@
#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"
@@ -97,16 +98,8 @@ class AutofillTableTest : public testing::Test {
#if defined(OS_MACOSX)
Encryptor::UseMockKeychain(true);
#endif
- PathService::Get(chrome::DIR_TEST_DATA, &file_);
- const std::string test_db = "TestWebDatabase" +
- base::Int64ToString(Time::Now().ToTimeT()) +
- ".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("TestWebDatabase");
}
static AutofillEntry MakeAutofillEntry(const char* name,
@@ -123,6 +116,7 @@ class AutofillTableTest : public testing::Test {
}
FilePath file_;
+ ScopedTempDir temp_dir_;
private:
DISALLOW_COPY_AND_ASSIGN(AutofillTableTest);
« no previous file with comments | « chrome/browser/password_manager/login_database_unittest.cc ('k') | chrome/browser/webdata/keyword_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698