Bug 1330529 - Part 1: Fix PDFium gtest by using absolute path to PDFium DLL. r=jimm

This gtest assumed the current working directory ($OBJDIR/_tests/gtest/) was in the DLL LoadLibrary path. That is no longer true with this bug's patches, so the gtest must specify the absolute path to the PDFium DLL to load it.

MozReview-Commit-ID: 5TXj6A9Tb9w

--HG--
extra : rebase_source : b097ae0c3430767e9ff16632ee96fd8739a902bf
extra : histedit_source : 1f13fa04c29039f8aeae05028d0a20ede5ee794b
This commit is contained in:
Chris Peterson 2018-02-11 11:58:21 -08:00
Родитель 5aa9b78a4d
Коммит 203d98bd72
1 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -124,12 +124,19 @@ public:
protected:
virtual bool CreatePDFiumEngineIfNeed() override {
if (!mPDFiumEngine) {
#ifdef _WIN64
nsAutoCString externalDll("pdfium_ref_x64.dll");
#else
nsAutoCString externalDll("pdfium_ref_x86.dll");
#endif
#ifdef _WIN64
#define PDFIUM_FILENAME "pdfium_ref_x64.dll"
#else
#define PDFIUM_FILENAME "pdfium_ref_x86.dll"
#endif
nsAutoString pdfiumPath;
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(GetFilePathViaSpecialDirectory(
NS_OS_CURRENT_WORKING_DIR,
PDFIUM_FILENAME,
pdfiumPath)));
const NS_ConvertUTF16toUTF8 externalDll(pdfiumPath);
mPDFiumEngine = PDFiumEngineShim::GetInstanceOrNull(externalDll);
MOZ_RELEASE_ASSERT(mPDFiumEngine);
}
return !!mPDFiumEngine;