summaryrefslogtreecommitdiff
path: root/writerperfect/qa/unit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-30 16:33:03 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-12-01 09:17:01 +0100
commit7dcb4fef3b2383f4dd4d5d5c9ebbe8f19f8f4c8e (patch)
tree1f98cde1b37dc8fce39a571243435e4e9cbb6409 /writerperfect/qa/unit
parent553a35bed7a7ffb5bcda98987eb4af8b79bc031f (diff)
EPUB export: support image popup for images and text
Handle relative links on image / text as data for a popup. Pick the images up from <base directory>/<base name>/<relative url> as a start. Change-Id: I9b6183d554e3792aa71dfffc19a671a0e4c302cc Reviewed-on: https://gerrit.libreoffice.org/45601 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/qa/unit')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx22
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/popup.odtbin0 -> 10103 bytes
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/popup/libreoffice.pngbin0 -> 766 bytes
3 files changed, 22 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index 04df33257b6d..1f7b64250724 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -89,6 +89,7 @@ public:
void testFontEmbedding();
void testImageLink();
void testFootnote();
+ void testPopup();
CPPUNIT_TEST_SUITE(EPUBExportTest);
CPPUNIT_TEST(testOutlineLevel);
@@ -126,6 +127,7 @@ public:
CPPUNIT_TEST(testFontEmbedding);
CPPUNIT_TEST(testImageLink);
CPPUNIT_TEST(testFootnote);
+ CPPUNIT_TEST(testPopup);
CPPUNIT_TEST_SUITE_END();
};
@@ -702,6 +704,26 @@ void EPUBExportTest::testFootnote()
assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside", "type", "footnote");
}
+void EPUBExportTest::testPopup()
+{
+ createDoc("popup.odt", {});
+
+ mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+ // Test image popup anchor.
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:p[1]/xhtml:a", "type", "noteref");
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:p[1]/xhtml:a/xhtml:img", 1);
+ // Test image popup content.
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside[1]", "type", "footnote");
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside[1]/xhtml:img", 1);
+
+ // Test text popup anchor.
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:p[2]/xhtml:span/xhtml:a", "type", "noteref");
+ assertXPathContent(mpXmlDoc, "//xhtml:body/xhtml:p[2]/xhtml:span/xhtml:a", "link");
+ // Test text popup content.
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside[2]", "type", "footnote");
+ assertXPath(mpXmlDoc, "//xhtml:body/xhtml:aside[2]/xhtml:img", 1);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
}
diff --git a/writerperfect/qa/unit/data/writer/epubexport/popup.odt b/writerperfect/qa/unit/data/writer/epubexport/popup.odt
new file mode 100644
index 000000000000..30f4cc8f526e
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/popup.odt
Binary files differ
diff --git a/writerperfect/qa/unit/data/writer/epubexport/popup/libreoffice.png b/writerperfect/qa/unit/data/writer/epubexport/popup/libreoffice.png
new file mode 100644
index 000000000000..fdad35484e7c
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/popup/libreoffice.png
Binary files differ