#include "pdf/test/test_document_loader.h"
#include <stdint.h>
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/notreached.h"
#include "pdf/loader/range_set.h"
#include "pdf/loader/url_loader_wrapper.h"
#include "pdf/test/test_helpers.h"
#include "ui/gfx/range/range.h"
namespace chrome_pdf {
namespace {
std::vector<uint8_t> ReadTestData(const base::FilePath::StringType& pdf_name) { … }
}
TestDocumentLoader::TestDocumentLoader(
Client* client,
const base::FilePath::StringType& pdf_name)
: … { … }
TestDocumentLoader::~TestDocumentLoader() = default;
bool TestDocumentLoader::SimulateLoadData(uint32_t max_bytes) { … }
bool TestDocumentLoader::Init(std::unique_ptr<URLLoaderWrapper> loader,
const std::string& url) { … }
bool TestDocumentLoader::GetBlock(uint32_t position,
uint32_t size,
void* buf) const { … }
bool TestDocumentLoader::IsDataAvailable(uint32_t position,
uint32_t size) const { … }
void TestDocumentLoader::RequestData(uint32_t position, uint32_t size) { … }
bool TestDocumentLoader::IsDocumentComplete() const { … }
uint32_t TestDocumentLoader::GetDocumentSize() const { … }
uint32_t TestDocumentLoader::BytesReceived() const { … }
void TestDocumentLoader::ClearPendingRequests() { … }
}