diff --git a/sd/CppunitTest_sd_pdf_import_test.mk b/sd/CppunitTest_sd_pdf_import_test.mk index 6dedcbf424ca..eb3a6ecf9389 100644 --- a/sd/CppunitTest_sd_pdf_import_test.mk +++ b/sd/CppunitTest_sd_pdf_import_test.mk @@ -49,6 +49,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_pdf_import_test, \ sd \ sfx \ sot \ + subsequenttest \ svl \ svt \ svx \ diff --git a/sd/qa/unit/SdrPdfImportTest.cxx b/sd/qa/unit/SdrPdfImportTest.cxx index f92c659a1bba..7c10eebc17e5 100644 --- a/sd/qa/unit/SdrPdfImportTest.cxx +++ b/sd/qa/unit/SdrPdfImportTest.cxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include @@ -69,31 +68,15 @@ private: }; } -class SdrPdfImportTest : public test::BootstrapFixture, public unotest::MacrosTest +class SdrPdfImportTest : public UnoApiTest { -protected: - uno::Reference mxComponent; - public: - virtual void setUp() override; - virtual void tearDown() override; + SdrPdfImportTest() + : UnoApiTest("/sd/qa/unit/data/") + { + } }; -void SdrPdfImportTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void SdrPdfImportTest::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - // Load the PDF in Draw, which will load the PDF as an Graphic, then // mark the graphic object and trigger "break" function. This should // convert the PDF content into objects/shapes. @@ -108,7 +91,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testImportSimpleText) // We need to enable PDFium import (and make sure to disable after the test) EnvVarGuard UsePDFiumGuard("LO_IMPORT_USE_PDFIUM", "1"); - mxComponent = loadFromDesktop(m_directories.getURLFromSrc(u"sd/qa/unit/data/SimplePDF.pdf")); + loadFromURL(u"SimplePDF.pdf"); auto pImpressDocument = dynamic_cast(mxComponent.get()); sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pViewShell); @@ -177,8 +160,7 @@ CPPUNIT_TEST_FIXTURE(SdrPdfImportTest, testAnnotationsImportExport) auto pPdfiumLibrary = vcl::pdf::PDFiumLibrary::get(); - mxComponent - = loadFromDesktop(m_directories.getURLFromSrc(u"sd/qa/unit/data/PdfWithAnnotation.pdf")); + loadFromURL(u"PdfWithAnnotation.pdf"); auto pImpressDocument = dynamic_cast(mxComponent.get()); sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell(); CPPUNIT_ASSERT(pViewShell);