Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: net/disk_cache/disk_cache_test_util.h

Issue 45061: Disk cache: Add a unit test that instantiates three caches... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_UTIL_H_ 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 20 matching lines...) Expand all
31 std::string GenerateKey(bool same_length); 31 std::string GenerateKey(bool same_length);
32 32
33 // Returns true if the cache is not corrupt. 33 // Returns true if the cache is not corrupt.
34 bool CheckCacheIntegrity(const std::wstring& path); 34 bool CheckCacheIntegrity(const std::wstring& path);
35 35
36 // Helper class which ensures that the cache dir returned by GetCachePath exists 36 // Helper class which ensures that the cache dir returned by GetCachePath exists
37 // and is clear in ctor and that the directory gets deleted in dtor. 37 // and is clear in ctor and that the directory gets deleted in dtor.
38 class ScopedTestCache { 38 class ScopedTestCache {
39 public: 39 public:
40 ScopedTestCache(); 40 ScopedTestCache();
41 ScopedTestCache(const std::wstring& name); // Use a specific folder name.
41 ~ScopedTestCache(); 42 ~ScopedTestCache();
42 43
43 FilePath path() const { return FilePath::FromWStringHack(path_); } 44 FilePath path() const { return FilePath::FromWStringHack(path_); }
44 std::wstring path_wstring() const { return path_; } 45 std::wstring path_wstring() const { return path_; }
45 46
46 private: 47 private:
47 const std::wstring path_; // Path to the cache test folder. 48 const std::wstring path_; // Path to the cache test folder.
48 49
49 DISALLOW_COPY_AND_ASSIGN(ScopedTestCache); 50 DISALLOW_COPY_AND_ASSIGN(ScopedTestCache);
50 }; 51 };
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 base::RepeatingTimer<MessageLoopHelper> timer_; 92 base::RepeatingTimer<MessageLoopHelper> timer_;
92 int num_callbacks_; 93 int num_callbacks_;
93 int num_iterations_; 94 int num_iterations_;
94 int last_; 95 int last_;
95 bool completed_; 96 bool completed_;
96 97
97 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper); 98 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper);
98 }; 99 };
99 100
100 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 101 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698