#include "public/fpdf_sysfontinfo.h"
#include <string>
#include <vector>
#include "build/build_config.h"
#include "core/fxcrt/compiler_specific.h"
#include "testing/embedder_test.h"
#include "testing/embedder_test_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
extern "C" {
void FakeRelease(FPDF_SYSFONTINFO* pThis) { … }
void FakeEnumFonts(FPDF_SYSFONTINFO* pThis, void* pMapper) { … }
void* FakeMapFont(FPDF_SYSFONTINFO* pThis,
int weight,
FPDF_BOOL bItalic,
int charset,
int pitch_family,
const char* face,
FPDF_BOOL* bExact) { … }
void* FakeGetFont(FPDF_SYSFONTINFO* pThis, const char* face) { … }
unsigned long FakeGetFontData(FPDF_SYSFONTINFO* pThis,
void* hFont,
unsigned int table,
unsigned char* buffer,
unsigned long buf_size) { … }
unsigned long FakeGetFaceName(FPDF_SYSFONTINFO* pThis,
void* hFont,
char* buffer,
unsigned long buf_size) { … }
int FakeGetFontCharset(FPDF_SYSFONTINFO* pThis, void* hFont) { … }
void FakeDeleteFont(FPDF_SYSFONTINFO* pThis, void* hFont) { … }
}
class FPDFUnavailableSysFontInfoEmbedderTest : public EmbedderTest { … };
class FPDFSysFontInfoEmbedderTest : public EmbedderTest { … };
}
TEST_F(FPDFUnavailableSysFontInfoEmbedderTest, Bug972518) { … }
TEST_F(FPDFSysFontInfoEmbedderTest, DefaultSystemFontInfo) { … }
TEST_F(FPDFSysFontInfoEmbedderTest, DefaultTTFMap) { … }
TEST_F(FPDFSysFontInfoEmbedderTest, DefaultTTFMapCountAndEntries) { … }