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

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: 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/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..c6720ad47092e841256babb86a5f3e6576a26170 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_);
+ file_util::CreateDirectory(tmp_profile);
Paweł Hajdan Jr. 2011/04/11 18:16:53 Could you check the return value of that? Just ASS
Mike West 2011/04/12 07:04:04 Done.
- launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_);
+ launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile);
}
bool LaunchAppWithProfile() {
@@ -298,11 +296,10 @@ public:
void TearDown() {
Paweł Hajdan Jr. 2011/04/11 18:16:53 You can remove the entire TearDown now.
Mike West 2011/04/12 07:04:04 Done.
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