diff options
author | Mark Hung <marklh9@gmail.com> | 2019-03-01 10:09:30 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2019-03-04 14:32:15 +0100 |
commit | d98d3e2a0bc087ec9157e8e32e9f0ea4207d36e2 (patch) | |
tree | d656dc2987effb49837cfdebb7219878ea5a76df /sd/qa | |
parent | 1b4cfd79240f153703a02d63639b3895ab7c1d1b (diff) |
tdf#44223: Export the audio of effects and transitions.
This will allow to round trip the test case for the slide
transition and the animation effect audio.
Change-Id: Iac524e6bbcdb0a29491cfeba63121c845685fd11
Reviewed-on: https://gerrit.libreoffice.org/68540
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 37 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 27 |
2 files changed, 37 insertions, 27 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index ae60952752fc..eda6827a6869 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -198,6 +198,7 @@ public: void testTdf119118(); void testTdf99213(); void testPotxExport(); + void testTdf44223(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -278,6 +279,7 @@ public: CPPUNIT_TEST(testTdf119118); CPPUNIT_TEST(testTdf99213); CPPUNIT_TEST(testPotxExport); + CPPUNIT_TEST(testTdf44223); CPPUNIT_TEST_SUITE_END(); @@ -297,6 +299,7 @@ public: { "wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" }, { "p", "http://schemas.openxmlformats.org/presentationml/2006/main" }, { "p14", "http://schemas.microsoft.com/office/powerpoint/2010/main" }, + { "r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships" }, { "w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main" }, { "a14", "http://schemas.microsoft.com/office/drawing/2010/main" }, { "wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" }, @@ -2066,6 +2069,40 @@ void SdOOXMLExportTest2::testPotxExport() assertXPath(pContentTypes, "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']", "ContentType", "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml"); } + +void SdOOXMLExportTest2::testTdf44223() +{ + utl::TempFile tempFile; + ::sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + + std::shared_ptr<SvStream> const pStream1(parseExportStream(tempFile, "media/audio1.wav")); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(11140), pStream1->remainingSize()); + + std::shared_ptr<SvStream> const pStream2(parseExportStream(tempFile, "media/audio2.wav")); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(28074), pStream2->remainingSize()); + + xmlDocPtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml"); + assertXPath(pXmlContentType, + "/ContentType:Types/ContentType:Override[@PartName='/media/audio1.wav']", + "ContentType", + "audio/x-wav"); + + assertXPath(pXmlContentType, + "/ContentType:Types/ContentType:Override[@PartName='/media/audio2.wav']", + "ContentType", + "audio/x-wav"); + + xmlDocPtr pDoc1 = parseExport(tempFile, "ppt/slides/slide1.xml"); + assertXPath(pDoc1 , "//p:audio/p:cMediaNode/p:tgtEl/p:sndTgt[@r:embed]", 1); + + xmlDocPtr pDoc2 = parseExport(tempFile, "ppt/slides/slide2.xml"); + assertXPath(pDoc2 , "//p:transition/p:sndAc/p:stSnd/p:snd[@r:embed]", 2); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 684dacbb7a84..44464e2559a2 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -44,8 +44,6 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> -#include <com/sun/star/document/XStorageBasedDocument.hpp> -#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/presentation/ClickAction.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> #include <com/sun/star/presentation/XPresentationSupplier.hpp> @@ -194,7 +192,6 @@ public: void testTdf123090(); void testTdf120028(); void testTdf120028b(); - void testTdf44223(); void testDescriptionImport(); void testTdf83247(); void testTdf47365(); @@ -282,7 +279,6 @@ public: CPPUNIT_TEST(testTdf123090); CPPUNIT_TEST(testTdf120028); CPPUNIT_TEST(testTdf120028b); - CPPUNIT_TEST(testTdf44223); CPPUNIT_TEST(testDescriptionImport); CPPUNIT_TEST(testTdf83247); CPPUNIT_TEST(testTdf47365); @@ -2632,29 +2628,6 @@ void SdImportTest::testTdf120028b() xDocShRef->DoClose(); } -void SdImportTest::testTdf44223() -{ - ::sd::DrawDocShellRef xDocShRef - = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf44223.pptx"), PPTX); - uno::Reference<document::XStorageBasedDocument> xSBD(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY); - CPPUNIT_ASSERT(xSBD.is()); - - uno::Reference<embed::XStorage> xStorage = xSBD->getDocumentStorage(); - CPPUNIT_ASSERT(xStorage.is()); - - uno::Reference<container::XNameAccess> xNameAccess(xStorage, uno::UNO_QUERY); - CPPUNIT_ASSERT(xNameAccess.is()); - - uno::Reference<embed::XStorage> xStorage_2(xNameAccess->getByName("Media"), uno::UNO_QUERY); - CPPUNIT_ASSERT(xStorage_2.is()); - uno::Reference< container::XNameAccess > xNameAccess_2(xStorage_2, uno::UNO_QUERY); - - CPPUNIT_ASSERT(xNameAccess_2->hasByName("audio1.wav")); - CPPUNIT_ASSERT(xNameAccess_2->hasByName("audio2.wav")); - - xDocShRef->DoClose(); -} - void SdImportTest::testDescriptionImport() { sd::DrawDocShellRef xDocShRef |