19 #ifndef PAGESPEED_KERNEL_BASE_FILE_SYSTEM_TEST_BASE_H_
20 #define PAGESPEED_KERNEL_BASE_FILE_SYSTEM_TEST_BASE_H_
29 namespace net_instaweb {
72 virtual int FileSize(StringPiece contents)
const = 0;
74 int FileContentSize(StringPiece contents)
const {
75 return contents.size();
80 int FileBlockSize(StringPiece contents, int64 default_file_size)
const {
81 return ((contents.size() + kBlockSize - 1) / kBlockSize) * kBlockSize +
99 void TestCreateFileInDir();
101 void TestRemoveDir();
103 void TestRecursivelyMakeDir();
104 void TestRecursivelyMakeDir_NoPermission();
105 void TestRecursivelyMakeDir_FileInPath();
106 void TestListContents();
111 void TestLockTimeout();
112 void TestLockBumping();
119 static const int kBlockSize = 4096;
127 void Notify()
override { count_++; }
128 int get_count() {
return count_; }
Definition: file_system.h:126
virtual Timer * timer()=0
Pointer to a timer to use in tests.
virtual int DefaultDirSize() const =0
const GoogleString & test_tmpdir()
Provide a temporary directory for tests to put files in.
Definition: file_system_test_base.h:63
virtual FileSystem * file_system()=0
Provide a pointer to your favorite filesystem implementation.
virtual int FileSize(StringPiece contents) const =0
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
int FileBlockSize(StringPiece contents, int64 default_file_size) const
Definition: file_system_test_base.h:80
Definition: file_system_test_base.h:124
Definition: file_system.h:76
Definition: file_system_test_base.h:38
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
virtual void DeleteRecursively(const StringPiece &filename)=0
Definition: google_message_handler.h:35