summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/disk_cache_test_base.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 22:33:47 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-15 22:33:47 +0000
commit79b3fec81e7ea7e4c35822588b1b61d5361e9f4b (patch)
treec0923710e5db89ee91ae37b304ed2e15e986c657 /net/disk_cache/disk_cache_test_base.h
parentc19d954f05f2b5cdc65c6e7cedf0f825643a2c68 (diff)
downloadchromium_src-79b3fec81e7ea7e4c35822588b1b61d5361e9f4b.zip
chromium_src-79b3fec81e7ea7e4c35822588b1b61d5361e9f4b.tar.gz
chromium_src-79b3fec81e7ea7e4c35822588b1b61d5361e9f4b.tar.bz2
Disk cache: Simplify some of the test infrastructure.
BUG=none TEST=none Review URL: http://codereview.chromium.org/8463031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_cache_test_base.h')
-rw-r--r--net/disk_cache/disk_cache_test_base.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/net/disk_cache/disk_cache_test_base.h b/net/disk_cache/disk_cache_test_base.h
index acd3ebd..9759a2b 100644
--- a/net/disk_cache/disk_cache_test_base.h
+++ b/net/disk_cache/disk_cache_test_base.h
@@ -7,13 +7,13 @@
#pragma once
#include "base/basictypes.h"
+#include "base/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/threading/thread.h"
#include "net/base/cache_type.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
-class FilePath;
-
namespace net {
class IOBuffer;
@@ -34,7 +34,22 @@ class MemBackendImpl;
// cache (and that do not need to be a DiskCacheTestWithCache) are susceptible
// to this problem; all such tests should use TEST_F(DiskCacheTest, ...).
class DiskCacheTest : public PlatformTest {
+ protected:
+ DiskCacheTest();
+ virtual ~DiskCacheTest();
+
+ // Copies a set of cache files from the data folder to the test folder.
+ bool CopyTestCache(const std::string& name);
+
+ // Deletes the contents of |cache_path_|.
+ bool CleanupCacheDir();
+
virtual void TearDown();
+
+ FilePath cache_path_;
+
+ private:
+ scoped_ptr<MessageLoop> message_loop_;
};
// Provides basic support for cache related tests.
@@ -140,7 +155,7 @@ class DiskCacheTestWithCache : public DiskCacheTest {
private:
void InitMemoryCache();
void InitDiskCache();
- void InitDiskCacheImpl(const FilePath& path);
+ void InitDiskCacheImpl();
base::Thread cache_thread_;
DISALLOW_COPY_AND_ASSIGN(DiskCacheTestWithCache);