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

Unified Diff: chrome/browser/importer/firefox_profile_lock_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: Needed to rebase; patch didn't apply cleanly to save_package_unittest. 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
« no previous file with comments | « chrome/browser/history/visit_database_unittest.cc ('k') | chrome/browser/importer/importer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/firefox_profile_lock_unittest.cc
diff --git a/chrome/browser/importer/firefox_profile_lock_unittest.cc b/chrome/browser/importer/firefox_profile_lock_unittest.cc
index bd3e1ec82fc2b25c28d064b27207c5e89637284d..aa6898a98790f20a49360a2660039efd40191ab7 100644
--- a/chrome/browser/importer/firefox_profile_lock_unittest.cc
+++ b/chrome/browser/importer/firefox_profile_lock_unittest.cc
@@ -6,6 +6,7 @@
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string_util.h"
+#include "base/memory/scoped_temp_dir.h"
#include "build/build_config.h"
#include "chrome/browser/importer/firefox_profile_lock.h"
#include "chrome/common/chrome_paths.h"
@@ -13,28 +14,16 @@
#include "testing/gtest/include/gtest/gtest.h"
class FirefoxProfileLockTest : public testing::Test {
- public:
protected:
virtual void SetUp() {
- ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_path_));
- FilePath::StringType dir_name = FILE_PATH_LITERAL("FirefoxProfileLockTest");
- dir_name.append(StringPrintf(
- FILE_PATH_LITERAL("-%d"), base::GetCurrentProcId()));
- test_path_ = test_path_.Append(dir_name);
- file_util::Delete(test_path_, true);
- file_util::CreateDirectory(test_path_);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
}
- virtual void TearDown() {
- ASSERT_TRUE(file_util::Delete(test_path_, true));
- ASSERT_FALSE(file_util::PathExists(test_path_));
- }
-
- FilePath test_path_;
+ ScopedTempDir temp_dir_;
};
TEST_F(FirefoxProfileLockTest, LockTest) {
- FirefoxProfileLock lock1(test_path_);
+ FirefoxProfileLock lock1(temp_dir_.path());
ASSERT_TRUE(lock1.HasAcquired());
lock1.Unlock();
ASSERT_FALSE(lock1.HasAcquired());
« no previous file with comments | « chrome/browser/history/visit_database_unittest.cc ('k') | chrome/browser/importer/importer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698