5#ifndef TESTING_TEST_LOADER_H_
6#define TESTING_TEST_LOADER_H_
10#include "core/fxcrt/raw_span.h"
11#include "core/fxcrt/span.h"
15 explicit TestLoader(pdfium::span<
const uint8_t> span);
23 const pdfium::raw_span<
const uint8_t> m_Span;
static void WriteBitmapToPng(FPDF_BITMAP bitmap, const std::string &filename)
static EmbedderTestEnvironment * GetInstance()
virtual void UnsupportedHandler(int type)
virtual void DoGoToAction(FPDF_FORMFILLINFO *info, int page_index, int zoom_mode, float *pos_arry, int array_size)
virtual int SetTimer(int msecs, TimerCallback fn)
virtual int Alert(FPDF_WIDESTRING message, FPDF_WIDESTRING title, int type, int icon)
virtual void DoURIAction(FPDF_BYTESTRING uri)
virtual FPDF_PAGE GetPage(FPDF_FORMFILLINFO *info, FPDF_DOCUMENT document, int page_index)
virtual void KillTimer(int id)
virtual void OnFocusChange(FPDF_FORMFILLINFO *info, FPDF_ANNOTATION annot, int page_index)
virtual void DoURIActionWithKeyboardModifier(FPDF_FORMFILLINFO *info, FPDF_BYTESTRING uri, int modifiers)
ScopedEmbedderTestPage(EmbedderTest *test, int page_index)
ScopedEmbedderTestPage & operator=(ScopedEmbedderTestPage &&) noexcept
ScopedEmbedderTestPage(ScopedEmbedderTestPage &&) noexcept
~ScopedEmbedderTestPage()
ScopedFPDFBitmap RenderLoadedPage(FPDF_PAGE page)
ScopedFPDFBitmap RenderLoadedPageWithFlags(FPDF_PAGE page, int flags)
ScopedEmbedderTestPage LoadScopedPage(int page_index)
void SetWholeFileAvailable()
void VerifySavedDocument(int width, int height, const char *md5)
FPDF_DOCUMENT OpenSavedDocumentWithPassword(const char *password)
void VerifySavedRendering(FPDF_PAGE page, int width, int height, const char *md5)
void SetInitialFormFieldHighlight(FPDF_FORMHANDLE form)
FPDF_DOCUMENT saved_document() const
void CloseSavedDocument()
FPDF_DOCUMENT OpenSavedDocument()
ScopedFPDFBitmap RenderSavedPageWithFlags(FPDF_PAGE page, int flags)
FPDF_FORMHANDLE SetupFormFillEnvironment(FPDF_DOCUMENT doc, JavaScriptOption javascript_option)
FPDF_PAGE LoadPageNoEvents(int page_index)
FPDF_PAGE LoadPage(int page_index)
FPDF_FORMHANDLE saved_form_handle() const
static void CompareBitmap(FPDF_BITMAP bitmap, int expected_width, int expected_height, const char *expected_md5sum)
void UnloadPage(FPDF_PAGE page)
bool OpenDocumentHelper(const char *password, LinearizeOption linearize_option, JavaScriptOption javascript_option, FakeFileAccess *network_simulator, ScopedFPDFDocument *document, ScopedFPDFAvail *avail, ScopedFPDFFormHandle *form_handle)
void ClosePDFFileForWrite()
static int GetBlockFromString(void *param, unsigned long pos, unsigned char *buf, unsigned long size)
FPDF_DOCUMENT document() const
ScopedFPDFBitmap RenderSavedPage(FPDF_PAGE page)
void UnloadPageNoEvents(FPDF_PAGE page)
void CreateAvail(FX_FILEAVAIL *file_avail, FPDF_FILEACCESS *file)
void CloseSavedPage(FPDF_PAGE page)
static std::string HashBitmap(FPDF_BITMAP bitmap)
void SetDocumentFromAvail()
FPDF_FORMHANDLE form_handle() const
static int BytesPerPixelForFormat(int format)
void CreateEmptyDocument()
FPDF_PAGE LoadSavedPage(int page_index)
void CreateEmptyDocumentWithoutFormFillEnvironment()
void SetRequestedDataAvailable()
void SetWholeFileAvailable()
FX_DOWNLOADHINTS * GetDownloadHints() const
FX_FILEAVAIL * GetFileAvail() const
FPDF_FILEACCESS * GetFileAccess() const
TestLoader(pdfium::span< const uint8_t > span)
static int GetBlock(void *param, unsigned long pos, unsigned char *pBuf, unsigned long size)
FXDIB_Format FXDIBFormatFromFPDFFormat(int format)
#define PDF_DATA_NOTAVAIL
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsFormAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS *hints)
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsPageAvail(FPDF_AVAIL avail, int page_index, FX_DOWNLOADHINTS *hints)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password)
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsDocAvail(FPDF_AVAIL avail, FX_DOWNLOADHINTS *hints)
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc)
FPDF_EXPORT int FPDF_CALLCONV FPDFAvail_IsLinearized(FPDF_AVAIL avail)
FPDF_EXPORT FPDF_AVAIL FPDF_CALLCONV FPDFAvail_Create(FX_FILEAVAIL *file_avail, FPDF_FILEACCESS *file)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPage_HasTransparency(FPDF_PAGE page)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO *unsp_info)
FPDF_EXPORT FPDF_PAGE FPDF_CALLCONV FPDF_LoadPage(FPDF_DOCUMENT document, int page_index)
FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageCount(FPDF_DOCUMENT document)
FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_LoadCustomDocument(FPDF_FILEACCESS *pFileAccess, FPDF_BYTESTRING password)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetHeight(FPDF_BITMAP bitmap)
FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageHeightF(FPDF_PAGE page)
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFBitmap_Create(int width, int height, int alpha)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetFormat(FPDF_BITMAP bitmap)
FPDF_EXPORT void *FPDF_CALLCONV FPDFBitmap_GetBuffer(FPDF_BITMAP bitmap)
FPDF_EXPORT int FPDF_CALLCONV FPDFBitmap_GetWidth(FPDF_BITMAP bitmap)
FPDF_EXPORT float FPDF_CALLCONV FPDF_GetPageWidthF(FPDF_PAGE page)
FPDF_EXPORT void FPDF_CALLCONV FPDF_ClosePage(FPDF_PAGE page)
CRYPT_md5_context CRYPT_MD5Start()
int GetCompsFromFormat(FXDIB_Format format)
UNSAFE_BUFFER_USAGE void * FXSYS_memset(void *ptr1, int val, size_t len)
int(* WriteBlock)(struct FPDF_FILEWRITE_ *pThis, const void *pData, unsigned long size)
void(* FSDK_UnSupport_Handler)(struct _UNSUPPORT_INFO *pThis, int nType)