| Index: net/disk_cache/disk_cache_test_util.h
|
| diff --git a/net/disk_cache/disk_cache_test_util.h b/net/disk_cache/disk_cache_test_util.h
|
| index 4277d027b144d225a0b3560eb41508af530a3894..05dce990f7035bdb8a2eecee2c7eb34ba6fc343e 100644
|
| --- a/net/disk_cache/disk_cache_test_util.h
|
| +++ b/net/disk_cache/disk_cache_test_util.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/file_path.h"
|
| #include "base/message_loop.h"
|
| #include "base/task.h"
|
|
|
| @@ -32,6 +33,22 @@ std::string GenerateKey(bool same_length);
|
| // Returns true if the cache is not corrupt.
|
| bool CheckCacheIntegrity(const std::wstring& path);
|
|
|
| +// Helper class which ensures that the cache dir returned by GetCachePath exists
|
| +// and is clear in ctor and that the directory gets deleted in dtor.
|
| +class ScopedTestCache {
|
| + public:
|
| + ScopedTestCache();
|
| + ~ScopedTestCache();
|
| +
|
| + FilePath path() const { return FilePath::FromWStringHack(path_); }
|
| + std::wstring path_wstring() const { return path_; }
|
| +
|
| + private:
|
| + const std::wstring path_; // Path to the cache test folder.
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedTestCache);
|
| +};
|
| +
|
| // -----------------------------------------------------------------------
|
|
|
| // Simple callback to process IO completions from the cache.
|
|
|