sd/CppunitTest_sd_pdf_import_test.mk |    1 +
 sd/qa/unit/SdrPdfImportTest.cxx      |   34 ++++++++--------------------------
 2 files changed, 9 insertions(+), 26 deletions(-)

New commits:
commit 160473c1f171f1d3fae4f798338e14eb8ccfdd0e
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Oct 26 10:10:23 2022 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Wed Oct 26 11:06:50 2022 +0200

    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 <[email protected]>

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 <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);

Reply via email to