#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "storage/browser/test/mock_bytes_provider.h"
#include "base/threading/thread_restrictions.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace storage {
MockBytesProvider::MockBytesProvider(
std::vector<uint8_t> data,
size_t* reply_request_count,
size_t* stream_request_count,
size_t* file_request_count,
std::optional<base::Time> file_modification_time)
: … { … }
MockBytesProvider::~MockBytesProvider() = default;
void MockBytesProvider::RequestAsReply(RequestAsReplyCallback callback) { … }
void MockBytesProvider::RequestAsStream(
mojo::ScopedDataPipeProducerHandle pipe) { … }
void MockBytesProvider::RequestAsFile(uint64_t source_offset,
uint64_t source_size,
base::File file,
uint64_t file_offset,
RequestAsFileCallback callback) { … }
}