Chromium Code Reviews| Index: chrome/browser/safe_browsing/bloom_filter_unittest.cc |
| diff --git a/chrome/browser/safe_browsing/bloom_filter_unittest.cc b/chrome/browser/safe_browsing/bloom_filter_unittest.cc |
| index f0d74c050456cff6c23a87dbe5816d694845f66c..3a883da9b3beb754556f2e868f6ed639bcd08261 100644 |
| --- a/chrome/browser/safe_browsing/bloom_filter_unittest.cc |
| +++ b/chrome/browser/safe_browsing/bloom_filter_unittest.cc |
| @@ -15,6 +15,7 @@ |
| #include "base/path_service.h" |
| #include "base/rand_util.h" |
| #include "base/string_util.h" |
| +#include "base/memory/scoped_temp_dir.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace { |
| @@ -89,9 +90,9 @@ TEST(SafeBrowsingBloomFilter, BloomFilterFile) { |
| filter_write->Insert(GenHash()); |
| // Remove any left over test filters and serialize. |
| - FilePath filter_path; |
| - PathService::Get(base::DIR_TEMP, &filter_path); |
| - filter_path = filter_path.AppendASCII("SafeBrowsingTestFilter"); |
| + ScopedTempDir temp_dir; |
| + ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| + FilePath filter_path = temp_dir.path().AppendASCII("SafeBrowsingTestFilter"); |
| file_util::Delete(filter_path, false); |
|
Paweł Hajdan Jr.
2011/04/12 08:32:02
This line shouldn't be needed.
Mike West
2011/04/12 12:00:05
Done.
|
| ASSERT_FALSE(file_util::PathExists(filter_path)); |
|
Paweł Hajdan Jr.
2011/04/12 08:32:02
This too.
Mike West
2011/04/12 12:00:05
Done.
|
| ASSERT_TRUE(filter_write->WriteFile(filter_path)); |
| @@ -111,6 +112,4 @@ TEST(SafeBrowsingBloomFilter, BloomFilterFile) { |
| EXPECT_EQ(0, |
| memcmp(filter_write->data(), filter_read->data(), filter_read->size())); |
| - |
| - file_util::Delete(filter_path, false); |
| } |