#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/disk_cache/disk_cache_test_util.h"
#include "base/check_op.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/blockfile/backend_impl.h"
#include "net/disk_cache/blockfile/file.h"
#include "net/disk_cache/cache_util.h"
Time;
std::string GenerateKey(bool same_length) { … }
void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls) { … }
scoped_refptr<net::IOBufferWithSize> CacheTestCreateAndFillBuffer(
size_t len,
bool no_nulls) { … }
bool CreateCacheTestFile(const base::FilePath& name) { … }
bool DeleteCache(const base::FilePath& path) { … }
bool CheckCacheIntegrity(const base::FilePath& path,
bool new_eviction,
int max_size,
uint32_t mask) { … }
TestBackendResultCompletionCallback::TestBackendResultCompletionCallback() =
default;
TestBackendResultCompletionCallback::~TestBackendResultCompletionCallback() =
default;
disk_cache::BackendResultCallback
TestBackendResultCompletionCallback::callback() { … }
TestEntryResultCompletionCallback::TestEntryResultCompletionCallback() =
default;
TestEntryResultCompletionCallback::~TestEntryResultCompletionCallback() =
default;
disk_cache::Backend::EntryResultCallback
TestEntryResultCompletionCallback::callback() { … }
TestRangeResultCompletionCallback::TestRangeResultCompletionCallback() =
default;
TestRangeResultCompletionCallback::~TestRangeResultCompletionCallback() =
default;
disk_cache::RangeResultCallback TestRangeResultCompletionCallback::callback() { … }
void TestRangeResultCompletionCallback::HelpSetResult(
const disk_cache::RangeResult& result) { … }
MessageLoopHelper::MessageLoopHelper() = default;
MessageLoopHelper::~MessageLoopHelper() = default;
bool MessageLoopHelper::WaitUntilCacheIoFinished(int num_callbacks) { … }
void MessageLoopHelper::TimerExpired() { … }
CallbackTest::CallbackTest(MessageLoopHelper* helper,
bool reuse)
: … { … }
CallbackTest::~CallbackTest() = default;
void CallbackTest::Run(int result) { … }
void CallbackTest::RunWithEntry(disk_cache::EntryResult result) { … }