chromium/net/disk_cache/disk_cache_test_util.cc

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#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) {}

// Quits the message loop when all callbacks are called or we've been waiting
// too long for them (2 secs without a callback).
void MessageLoopHelper::TimerExpired() {}

// -----------------------------------------------------------------------

CallbackTest::CallbackTest(MessageLoopHelper* helper,
                           bool reuse)
    :{}

CallbackTest::~CallbackTest() = default;

// On the actual callback, increase the number of tests received and check for
// errors (an unexpected test received)
void CallbackTest::Run(int result) {}

void CallbackTest::RunWithEntry(disk_cache::EntryResult result) {}