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

Unified Diff: chrome/browser/history/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: 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/text_database_unittest.cc ('k') | chrome/browser/history/visit_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/url_database_unittest.cc
diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc
index a8e53c5ca9faf0774737e91b9b5145bccd83d603..121950da3bb7dc0031925c48b3bcd675e39f596a 100644
--- a/chrome/browser/history/url_database_unittest.cc
+++ b/chrome/browser/history/url_database_unittest.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/sql/connection.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/memory/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -47,11 +48,10 @@ class URLDatabaseTest : public testing::Test,
private:
// Test setup.
void SetUp() {
- FilePath temp_dir;
- PathService::Get(base::DIR_TEMP, &temp_dir);
- db_file_ = temp_dir.AppendASCII("URLTest.db");
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ FilePath db_file = temp_dir_.path().AppendASCII("URLTest.db");
- EXPECT_TRUE(db_.Open(db_file_));
+ EXPECT_TRUE(db_.Open(db_file));
// Initialize the tables for this test.
CreateURLTable(false);
@@ -61,10 +61,9 @@ class URLDatabaseTest : public testing::Test,
}
void TearDown() {
db_.Close();
- file_util::Delete(db_file_, false);
}
- FilePath db_file_;
+ ScopedTempDir temp_dir_;
sql::Connection db_;
};
« no previous file with comments | « chrome/browser/history/text_database_unittest.cc ('k') | chrome/browser/history/visit_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698