OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
6 #define NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
11 #include "base/scoped_temp_dir.h" | |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "net/base/cache_type.h" | 13 #include "net/base/cache_type.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 class IOBuffer; | 19 class IOBuffer; |
20 | 20 |
21 } // namespace net | 21 } // namespace net |
(...skipping 20 matching lines...) Expand all Loading... |
42 bool CopyTestCache(const std::string& name); | 42 bool CopyTestCache(const std::string& name); |
43 | 43 |
44 // Deletes the contents of |cache_path_|. | 44 // Deletes the contents of |cache_path_|. |
45 bool CleanupCacheDir(); | 45 bool CleanupCacheDir(); |
46 | 46 |
47 virtual void TearDown() OVERRIDE; | 47 virtual void TearDown() OVERRIDE; |
48 | 48 |
49 FilePath cache_path_; | 49 FilePath cache_path_; |
50 | 50 |
51 private: | 51 private: |
52 ScopedTempDir temp_dir_; | 52 base::ScopedTempDir temp_dir_; |
53 scoped_ptr<MessageLoop> message_loop_; | 53 scoped_ptr<MessageLoop> message_loop_; |
54 }; | 54 }; |
55 | 55 |
56 // Provides basic support for cache related tests. | 56 // Provides basic support for cache related tests. |
57 class DiskCacheTestWithCache : public DiskCacheTest { | 57 class DiskCacheTestWithCache : public DiskCacheTest { |
58 protected: | 58 protected: |
59 DiskCacheTestWithCache(); | 59 DiskCacheTestWithCache(); |
60 virtual ~DiskCacheTestWithCache(); | 60 virtual ~DiskCacheTestWithCache(); |
61 | 61 |
62 void InitCache(); | 62 void InitCache(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 private: | 160 private: |
161 void InitMemoryCache(); | 161 void InitMemoryCache(); |
162 void InitDiskCache(); | 162 void InitDiskCache(); |
163 void InitDiskCacheImpl(); | 163 void InitDiskCacheImpl(); |
164 | 164 |
165 base::Thread cache_thread_; | 165 base::Thread cache_thread_; |
166 DISALLOW_COPY_AND_ASSIGN(DiskCacheTestWithCache); | 166 DISALLOW_COPY_AND_ASSIGN(DiskCacheTestWithCache); |
167 }; | 167 }; |
168 | 168 |
169 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ | 169 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_BASE_H_ |
OLD | NEW |