| Index: net/disk_cache/disk_cache_perftest.cc
|
| diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc
|
| index 785f93f7532026cc8ec5b3a39daca75c9f78bffd..0abbc5b64e57b9c20dd282ad08b2dc330eaed0de 100644
|
| --- a/net/disk_cache/disk_cache_perftest.cc
|
| +++ b/net/disk_cache/disk_cache_perftest.cc
|
| @@ -157,10 +157,9 @@ TEST_F(DiskCacheTest, Hash) {
|
| TEST_F(DiskCacheTest, CacheBackendPerformance) {
|
| MessageLoopForIO message_loop;
|
|
|
| - std::wstring path_wstring = GetCachePath();
|
| - ASSERT_TRUE(DeleteCache(path_wstring.c_str()));
|
| - disk_cache::Backend* cache = disk_cache::CreateCacheBackend(path_wstring,
|
| - false, 0);
|
| + ScopedTestCache test_cache;
|
| + disk_cache::Backend* cache =
|
| + disk_cache::CreateCacheBackend(test_cache.path_wstring(), false, 0);
|
| ASSERT_TRUE(NULL != cache);
|
|
|
| int seed = static_cast<int>(Time::Now().ToInternalValue());
|
| @@ -175,20 +174,18 @@ TEST_F(DiskCacheTest, CacheBackendPerformance) {
|
| MessageLoop::current()->RunAllPending();
|
| delete cache;
|
|
|
| - FilePath path = FilePath::FromWStringHack(path_wstring);
|
| -
|
| ASSERT_TRUE(file_util::EvictFileFromSystemCache(
|
| - path.AppendASCII("index")));
|
| + test_cache.path().AppendASCII("index")));
|
| ASSERT_TRUE(file_util::EvictFileFromSystemCache(
|
| - path.AppendASCII("data_0")));
|
| + test_cache.path().AppendASCII("data_0")));
|
| ASSERT_TRUE(file_util::EvictFileFromSystemCache(
|
| - path.AppendASCII("data_1")));
|
| + test_cache.path().AppendASCII("data_1")));
|
| ASSERT_TRUE(file_util::EvictFileFromSystemCache(
|
| - path.AppendASCII("data_2")));
|
| + test_cache.path().AppendASCII("data_2")));
|
| ASSERT_TRUE(file_util::EvictFileFromSystemCache(
|
| - path.AppendASCII("data_3")));
|
| + test_cache.path().AppendASCII("data_3")));
|
|
|
| - cache = disk_cache::CreateCacheBackend(path_wstring, false, 0);
|
| + cache = disk_cache::CreateCacheBackend(test_cache.path_wstring(), false, 0);
|
| ASSERT_TRUE(NULL != cache);
|
|
|
| ret = TimeRead(num_entries, cache, entries, true);
|
| @@ -208,10 +205,10 @@ TEST_F(DiskCacheTest, CacheBackendPerformance) {
|
| // by using multiple, highly fragmented files.
|
| TEST_F(DiskCacheTest, BlockFilesPerformance) {
|
| MessageLoopForIO message_loop;
|
| - std::wstring path = GetCachePath();
|
| - ASSERT_TRUE(DeleteCache(path.c_str()));
|
|
|
| - disk_cache::BlockFiles files(path);
|
| + ScopedTestCache test_cache;
|
| +
|
| + disk_cache::BlockFiles files(test_cache.path_wstring());
|
| ASSERT_TRUE(files.Init(true));
|
|
|
| int seed = static_cast<int>(Time::Now().ToInternalValue());
|
|
|