1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/unoapixml_test.hxx>
11 #include <test/htmltesttools.hxx>
15 class SdHTMLFilterTest
: public UnoApiXmlTest
, public HtmlTestTools
19 : UnoApiXmlTest(u
"/sd/qa/unit/data/"_ustr
)
25 loadFromFile(u
"HtmlExportTestDocument.odp");
26 save(u
"impress_html_Export"_ustr
);
27 htmlDocUniquePtr htmlDoc
= parseHtml(maTempFile
);
29 assertXPath(htmlDoc
, "/html", 1);
30 assertXPath(htmlDoc
, "/html/body", 1);
31 assertXPath(htmlDoc
, "/html/body/h1", 4);
32 assertXPath(htmlDoc
, "/html/body/table", 1);
33 assertXPath(htmlDoc
, "/html/body/table/tr", 5);
34 assertXPath(htmlDoc
, "/html/body/ul", 1);
35 assertXPath(htmlDoc
, "/html/body/ul/li", 2);
37 assertXPath(htmlDoc
, "/html/head/meta[1]", "content", u
"text/html; charset=utf-8");
38 assertXPath(htmlDoc
, "/html/head/meta[2]", "name", u
"generator");
39 assertXPath(htmlDoc
, "/html/head/meta[3]", "name", u
"created");
40 assertXPath(htmlDoc
, "/html/head/meta[3]", "content", u
"2014-04-09T17:05:41.987922038");
45 loadFromFile(u
"tdf154989.odg");
46 save(u
"XHTML Draw File"_ustr
);
47 xmlDocUniquePtr pXmlDoc
= parseXml(maTempFile
);
49 assertXPath(pXmlDoc
, "/xhtml:html", 1);
51 assertXPath(pXmlDoc
, "/xhtml:html/xhtml:body/xhtml:div", 1);
53 assertXPath(pXmlDoc
, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div", 4);
54 // 3 of them are text boxes
55 assertXPath(pXmlDoc
, "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div/xhtml:div", 3);
56 // not sure if the order of these is stable?
57 assertXPathContent(pXmlDoc
,
58 "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[2]/xhtml:div/xhtml:p",
60 assertXPathContent(pXmlDoc
,
61 "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[3]/xhtml:div/xhtml:p",
63 assertXPathContent(pXmlDoc
,
64 "/xhtml:html/xhtml:body/xhtml:div[1]/xhtml:div[4]/xhtml:div/xhtml:p",
68 CPPUNIT_TEST_SUITE(SdHTMLFilterTest
);
69 CPPUNIT_TEST(testHTMLExport
);
70 CPPUNIT_TEST(testTdf154989
);
71 CPPUNIT_TEST_SUITE_END();
74 CPPUNIT_TEST_SUITE_REGISTRATION(SdHTMLFilterTest
);
76 CPPUNIT_PLUGIN_IMPLEMENT();
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */