summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-10-26 10:10:23 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-10-26 11:06:50 +0200
commit160473c1f171f1d3fae4f798338e14eb8ccfdd0e (patch)
treef83e0ddb0b334fe588861c68852580775ff4e87d /sd/qa
parent58002ab85d992c7ac44d8bb4d135246b67aa5cc7 (diff)
CppunitTest_sd_pdf_import_test: inherit from UnoApiTest
Change-Id: I8bd1c930896935770cdf7453550340cbc8b79f55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141862 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/SdrPdfImportTest.cxx34
1 files changed, 8 insertions, 26 deletions
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 <test/bootstrapfixture.hxx>
-#include <unotest/macros_test.hxx>
+#include <test/unoapi_test.hxx>
#include <comphelper/scopeguard.hxx>
#include <comphelper/propertysequence.hxx>
@@ -69,31 +68,15 @@ private:
};
}
-class SdrPdfImportTest : public test::BootstrapFixture, public unotest::MacrosTest
+class SdrPdfImportTest : public UnoApiTest
{
-protected:
- uno::Reference<lang::XComponent> 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<SdXImpressDocument*>(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<SdXImpressDocument*>(mxComponent.get());
sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell();
CPPUNIT_ASSERT(pViewShell);