Chromium Code Reviews| 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..0b01e006e97dc1712cbeab303fb175bfd37311a6 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,12 @@ void MakeTestSkBitmap(int w, int h, SkBitmap* bmp) { |
| class BookmarkHTMLWriterTest : public TestingBrowserProcessTest { |
| protected: |
| virtual void SetUp() { |
|
Paweł Hajdan Jr.
2011/04/08 15:58:17
Oh, could you also make it call the parent's SetUp
Mike West
2011/04/11 14:47:04
Done.
|
| - ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &path_)); |
| - path_ = path_.AppendASCII("bookmarks.html"); |
| + ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| + path_ = temp_dir_.path().AppendASCII("bookmarks.html"); |
| file_util::Delete(path_, true); |
|
Paweł Hajdan Jr.
2011/04/08 15:58:17
Shouldn't be needed.
Mike West
2011/04/11 14:47:04
Done.
|
| } |
| virtual void TearDown() { |
|
Paweł Hajdan Jr.
2011/04/08 15:58:17
Can you remove it entirely then?
Mike West
2011/04/11 14:47:04
Done.
|
| - if (!path_.empty()) |
| - file_util::Delete(path_, true); |
| } |
| // Converts a BookmarkEntry to a string suitable for assertion testing. |
| @@ -120,6 +119,7 @@ class BookmarkHTMLWriterTest : public TestingBrowserProcessTest { |
| BookmarkEntryToString(entry)); |
| } |
| + ScopedTempDir temp_dir_; |
| FilePath path_; |
| }; |