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

Unified Diff: chrome/browser/bookmarks/bookmark_html_writer_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 | « base/i18n/file_util_icu_unittest.cc ('k') | chrome/browser/download/save_package_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
index 720445a64f2a177609d212a19580300ffbc7e8d9..f203a04042148e182e174418fa3df8f8bec21e71 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
@@ -12,6 +12,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/i18n/time_formatting.h"
+#include "base/memory/scoped_temp_dir.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/importer/firefox2_importer.h"
@@ -43,14 +44,9 @@ void MakeTestSkBitmap(int w, int h, SkBitmap* bmp) {
class BookmarkHTMLWriterTest : public TestingBrowserProcessTest {
protected:
virtual void SetUp() {
- ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_));
- path_ = path_.AppendASCII("bookmarks.html");
- file_util::Delete(path_, true);
- }
-
- virtual void TearDown() {
- if (!path_.empty())
- file_util::Delete(path_, true);
+ TestingBrowserProcessTest::SetUp();
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ path_ = temp_dir_.path().AppendASCII("bookmarks.html");
}
// Converts a BookmarkEntry to a string suitable for assertion testing.
@@ -120,6 +116,7 @@ class BookmarkHTMLWriterTest : public TestingBrowserProcessTest {
BookmarkEntryToString(entry));
}
+ ScopedTempDir temp_dir_;
FilePath path_;
};
« no previous file with comments | « base/i18n/file_util_icu_unittest.cc ('k') | chrome/browser/download/save_package_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698