summaryrefslogtreecommitdiff
path: root/sd/qa/unit/SVGExportTests.cxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-11-05 12:49:20 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-05 16:13:12 +0100
commit87e0c9f6d7d753fbe4ade55d7c15ee07b1118c56 (patch)
treeda2a2958917c2b962d1d55ea3eda3b45528cde5a /sd/qa/unit/SVGExportTests.cxx
parentd54aaea33bf2dab86c0ead4bd142c593d017f930 (diff)
sd: add support for svg export unit tests
Change-Id: Iafeaecad612b724c4eeb85e0c01c942afb6445d8
Diffstat (limited to 'sd/qa/unit/SVGExportTests.cxx')
-rw-r--r--sd/qa/unit/SVGExportTests.cxx72
1 files changed, 72 insertions, 0 deletions
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
new file mode 100644
index 000000000000..8dbbbc9cb66e
--- /dev/null
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "sdmodeltestbase.hxx"
+
+#include <test/xmltesttools.hxx>
+#include <unotools/mediadescriptor.hxx>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
+
+using namespace css;
+
+class SdSVGFilterTest : public SdModelTestBase, public XmlTestTools
+{
+ uno::Reference<lang::XComponent> mxComponent;
+ utl::TempFile maTempFile;
+
+public:
+ SdSVGFilterTest()
+ {
+ maTempFile.EnableKillingFile();
+ }
+
+ virtual void setUp() override
+ {
+ SdModelTestBase::setUp();
+
+ mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
+ }
+
+ virtual void tearDown() override
+ {
+ if (mxComponent.is())
+ mxComponent->dispose();
+
+ SdModelTestBase::tearDown();
+ }
+
+ void testSVGExportTextDecorations()
+ {
+ mxComponent = loadFromDesktop(getURLFromSrc("/sd/qa/unit/data/odp/svg-export-text-decorations.odp"));
+ CPPUNIT_ASSERT(mxComponent.is());
+
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ utl::MediaDescriptor aMediaDescriptor;
+ OUString aFilterName("impress_svg_Export");
+ aMediaDescriptor["FilterName"] <<= aFilterName;
+ xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList());
+ xmlDocPtr pXmlDoc = parseXml(maTempFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // TODO use assertXPath() here.
+ }
+
+ CPPUNIT_TEST_SUITE(SdSVGFilterTest);
+ CPPUNIT_TEST(testSVGExportTextDecorations);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(SdSVGFilterTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */