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

Unified Diff: chrome/browser/ui/tests/browser_uitest.cc

Issue 6793008: Replacing base::DIR_TEMP with ScopedTempDir when appropriate. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Paweł's comments on Round 2. 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/ui/tests/browser_uitest.cc
diff --git a/chrome/browser/ui/tests/browser_uitest.cc b/chrome/browser/ui/tests/browser_uitest.cc
index b756caa438481cc539501f26fedcc8a1dda34c13..ead99ff32871f04d384d1f0d4aa609adb480aee4 100644
--- a/chrome/browser/ui/tests/browser_uitest.cc
+++ b/chrome/browser/ui/tests/browser_uitest.cc
@@ -280,15 +280,13 @@ TEST_F(KioskModeTest, EnableKioskModeTest) {
class LaunchBrowserWithNonAsciiUserDatadir : public UITest {
public:
void SetUp() {
- PathService::Get(base::DIR_TEMP, &tmp_profile_);
- tmp_profile_ = tmp_profile_.AppendASCII("tmp_profile");
- tmp_profile_ = tmp_profile_.Append(L"Test Chrome G�raldine");
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ FilePath tmp_profile = temp_dir_.path().AppendASCII("tmp_profile");
+ tmp_profile = tmp_profile.Append(L"Test Chrome G�raldine");
- // Create a fresh, empty copy of this directory.
- file_util::Delete(tmp_profile_, true);
- file_util::CreateDirectory(tmp_profile_);
+ ASSERT_TRUE(file_util::CreateDirectory(tmp_profile));
- launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_);
+ launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile);
}
bool LaunchAppWithProfile() {
@@ -296,13 +294,8 @@ public:
return true;
}
- void TearDown() {
- UITest::TearDown();
- EXPECT_TRUE(file_util::DieFileDie(tmp_profile_, true));
- }
-
public:
- FilePath tmp_profile_;
+ ScopedTempDir temp_dir_;
};
TEST_F(LaunchBrowserWithNonAsciiUserDatadir, TestNonAsciiUserDataDir) {

Powered by Google App Engine
This is Rietveld 408576698