Chromium Code Reviews| Index: net/disk_cache/disk_cache_test_util.cc |
| diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc |
| index ed16db0170473845f41c653529769283d0d51d03..225f61da8f84db657ced067b74815af720df5e8f 100644 |
| --- a/net/disk_cache/disk_cache_test_util.cc |
| +++ b/net/disk_cache/disk_cache_test_util.cc |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2006-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. |
| @@ -8,19 +8,25 @@ |
| #include "base/file_util.h" |
| #include "base/message_loop_proxy.h" |
| #include "base/path_service.h" |
| +#include "base/memory/scoped_temp_dir.h" |
| #include "net/base/net_errors.h" |
| #include "net/disk_cache/backend_impl.h" |
| #include "net/disk_cache/cache_util.h" |
| #include "net/disk_cache/file.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| using base::Time; |
| using base::TimeDelta; |
| namespace { |
| +ScopedTempDir temp_dir_; |
| + |
| FilePath BuildCachePath(const std::string& name) { |
| - FilePath path; |
| - PathService::Get(base::DIR_TEMP, &path); // Ignore return value; |
| + if (!temp_dir_.IsValid()) |
|
Paweł Hajdan Jr.
2011/04/11 18:16:53
Oh, let's leave this one as-is. I know Ricardo Var
Mike West
2011/04/12 07:04:04
Great, this is exactly why I'm thrilled you're rev
|
| + DCHECK(temp_dir_.CreateUniqueTempDir()); |
| + |
| + FilePath path = temp_dir_.path(); |
| path = path.AppendASCII(name); |
| if (!file_util::PathExists(path)) |
| file_util::CreateDirectory(path); |