From ffe9dfbbc64c7ce873f3a83c046ec417d07eaa4e Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 26 Oct 2022 13:23:04 +0200 Subject: [PATCH] CppunitTest_sd_html_export_tests: inherit from UnoApiTest Change-Id: Ia51a023102f83406d83f5bfa92bb7dda31ee9dc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141872 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sd/CppunitTest_sd_html_export_tests.mk | 1 + sd/qa/unit/HtmlExportTest.cxx | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/sd/CppunitTest_sd_html_export_tests.mk b/sd/CppunitTest_sd_html_export_tests.mk index 268f2b193dc4..1d6968886005 100644 --- a/sd/CppunitTest_sd_html_export_tests.mk +++ b/sd/CppunitTest_sd_html_export_tests.mk @@ -40,6 +40,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_html_export_tests, \ sd \ sfx \ sot \ + subsequenttest \ svl \ svt \ svx \ diff --git a/sd/qa/unit/HtmlExportTest.cxx b/sd/qa/unit/HtmlExportTest.cxx index ea8de7b9be06..2e7885e062d8 100644 --- a/sd/qa/unit/HtmlExportTest.cxx +++ b/sd/qa/unit/HtmlExportTest.cxx @@ -7,32 +7,25 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "sdmodeltestbase.hxx" - +#include #include #include using namespace css; -class SdHTMLFilterTest : public SdModelTestBase, public XmlTestTools, public HtmlTestTools +class SdHTMLFilterTest : public UnoApiTest, public XmlTestTools, public HtmlTestTools { -private: - htmlDocUniquePtr exportAndParseHtml(sd::DrawDocShellRef const& xDocShRef) +public: + SdHTMLFilterTest() + : UnoApiTest("/sd/qa/unit/data/") { - FileFormat* pFormat = getFormat(HTML); - OUString aExt = "." + OUString::createFromAscii(pFormat->pName); - utl::TempFileNamed aTempFile(u"", true, aExt); - aTempFile.EnableKillingFile(); - exportTo(xDocShRef.get(), pFormat, aTempFile); - return parseHtml(aTempFile); } -public: void testHTMLExport() { - sd::DrawDocShellRef xDocShRef = loadURL( - m_directories.getURLFromSrc(u"/sd/qa/unit/data/HtmlExportTestDocument.odp"), ODP); - htmlDocUniquePtr htmlDoc = exportAndParseHtml(xDocShRef); + loadFromURL(u"HtmlExportTestDocument.odp"); + utl::TempFileNamed aTempFile = save("impress_html_Export"); + htmlDocUniquePtr htmlDoc = parseHtml(aTempFile); assertXPath(htmlDoc, "/html", 1); assertXPath(htmlDoc, "/html/body", 1);