Blame 0001-CppunitTest_sw_htmlexport-The-actual-PNG-data-does-n.patch

ff64f62
From 824e092dbfefe2366f39e55a3efcc3d99dc1cbf7 Mon Sep 17 00:00:00 2001
ff64f62
From: Jan Holesovsky <kendy@collabora.com>
ff64f62
Date: Tue, 25 Aug 2020 15:16:21 +0200
ff64f62
Subject: [PATCH] CppunitTest_sw_htmlexport: The actual PNG data does not
ff64f62
 matter.
ff64f62
ff64f62
The test was supposed to test whether the PNG data is embedded (or not),
ff64f62
not the actual content of the data.  Turns out that a different zlib
ff64f62
affects the PNG content, so let's ignore that part, and only check that
ff64f62
the data is actually embedded.
ff64f62
ff64f62
Change-Id: I603bd546d97abda7c47248db0a95349f4a48b4aa
ff64f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101329
ff64f62
Tested-by: Jenkins
ff64f62
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
ff64f62
---
ff64f62
 sw/qa/extras/htmlexport/htmlexport.cxx | 10 +++++++++-
ff64f62
 1 file changed, 9 insertions(+), 1 deletion(-)
ff64f62
ff64f62
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
ff64f62
index 36df600df185..d4d59103fffe 100644
ff64f62
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
ff64f62
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
ff64f62
@@ -357,6 +357,8 @@ DECLARE_HTMLEXPORT_TEST(testNormalImageExport, "textAndImage.docx")
ff64f62
     CPPUNIT_ASSERT(pDoc);
ff64f62
 
ff64f62
     assertXPath(pDoc, "/html/body", 1);
ff64f62
+
ff64f62
+    // the HTML export normally does not embed the images
ff64f62
     OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
ff64f62
     CPPUNIT_ASSERT(imgSrc.endsWith(".png"));
ff64f62
 }
ff64f62
@@ -367,7 +369,13 @@ DECLARE_HTMLEXPORT_TEST(testEmbedImagesEnabled, "textAndImage.docx")
ff64f62
     CPPUNIT_ASSERT(pDoc);
ff64f62
 
ff64f62
     assertXPath(pDoc, "/html/body", 1);
ff64f62
-    assertXPath(pDoc, "/html/body/p/img", "src", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAA3ZAAAN2QHmodeGAAAFyUlEQVR4nO1Za2gcVRQ+szuzO9ndZtfEktY2tVorVdNKxRpQweqPmh/B1w8JhCL4R4RYiPhCfKFEfwX/2VYULJIqJFDqg4KC1EaoEoyGhFJClBgbN+a9z9ndeXnOzJ3szCbbQuY2i5ADh5udmXvP953z3cdMRNM04f9sYq0B+LVNArW2TQJXM0EQdmKTQL+Mi4V2PWJwJ4CgBUkKdImi9F48HpGikTptfj4l19fLX2cyxeeQyALPeNwJxOOx/r17djz6+afdsX233QBg5CCXWYS3es62n/js4mXkdyeSmOMVjysBURQ7djVvbRv87p2oLJUAtHmLQDSUg963W8MhMSscPzXWh48e4RaT10BkKJkXens6orKYRvBZC7zlut2+231r6MOTI4exCgmswjKPmFwJFIvFu+5pqbczr7vB22QkMwd7d8vK2Hj+AD5+gUdMrgRCUnD+yt9T8ZubGsrAHSKMTHK2SDGTvGJyJaBp2g/9Z4abH7j7YMjJupvA0Mgi5BVDxUcneMXkSiCTVV/75ItLTx1qCTR2PpbwEJiYTMHjXamcUjSfMTmeIH0TwAm5H5s96JPou3N57f3n3xh99URfuL79IVmOR1UYGlXUL89phqrCabuLcAjbRvQCcjlfMwII5PCWaPib1ntv0S4O/Skn4jHhjn27FMPQ4d/ZJePjgWzJNExBDCW0gwciWp0ceLpQLHaMjM3UNTeZhcU0CLGI8FE2b75SEwJhSWx/ueuR6JvdD8Kx18+Yl/4oCN8PHEP9KyibAoC50krO76Hf/4EjnUkYHYDY+F8A93XCszhUbQiQSUHcsPQFJINz00TX5hhodCJS2WpLIAbBDARAkMN+o/OYxEYeQS0y0Gz3rQTtJmQs+0ftMp8EDFsm+qLdmvhbn7cBr8o+k5Se5oOcGZ8K6E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ASUVORK5CYII=");
ff64f62
+
ff64f62
+    // the HTML export normally does not embed the images, but here the test
ff64f62
+    // name triggers setting of the "EmbedImages" filter option, meaning the
ff64f62
+    // image will not be a separate PNG, but an embedded base64 encoded
ff64f62
+    // version of that
ff64f62
+    OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
ff64f62
+    CPPUNIT_ASSERT(imgSrc.startsWith("data:image/png;base64,"));
ff64f62
 }
ff64f62
 
ff64f62
 DECLARE_HTMLEXPORT_TEST(testXHTML, "hello.html")
ff64f62
-- 
ff64f62
2.28.0
ff64f62