diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-07-21 11:45:36 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-07-21 19:49:51 +0200 |
commit | 71ab0b8b8368b5010d3af4100d5ea3ca38b725a5 (patch) | |
tree | 3fb3d5f7caf3f5e31bde312bdc01c90016ddab5b /sd/qa/unit/export-tests-ooxml2.cxx | |
parent | ee6f8f1982d666f8fcda96d2141a9332a10b8273 (diff) |
sd pptm: Unit tests for the .pptm support.
Change-Id: Ie0d05e70fe2b0869470a1750d5b60566f129247b
Reviewed-on: https://gerrit.libreoffice.org/40268
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd/qa/unit/export-tests-ooxml2.cxx')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index f310309d0bf2..848ea8f5d1a4 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -98,6 +98,8 @@ public: void testTdf59046(); void testTdf105739(); void testPageBitmapWithTransparency(); + void testPptmContentType(); + void testPptmVBAStream(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest2); @@ -123,6 +125,8 @@ public: CPPUNIT_TEST(testTdf59046); CPPUNIT_TEST(testTdf105739); CPPUNIT_TEST(testPageBitmapWithTransparency); + CPPUNIT_TEST(testPptmContentType); + CPPUNIT_TEST(testPptmVBAStream); CPPUNIT_TEST_SUITE_END(); @@ -804,6 +808,34 @@ void SdOOXMLExportTest2::testPageBitmapWithTransparency() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testPptmContentType() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptm/macro.pptm"), PPTM); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile); + + // Assert that the content type is the one of PPTM + xmlDocPtr pXmlContentType = parseExport(tempFile, "[Content_Types].xml"); + assertXPath(pXmlContentType, + "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']", + "ContentType", + "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml"); + + xDocShRef->DoClose(); +} + +void SdOOXMLExportTest2::testPptmVBAStream() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptm/macro.pptm"), PPTM); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTM, &tempFile); + + uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), tempFile.GetURL()); + // This failed: VBA stream was not roundtripped + CPPUNIT_ASSERT(xNameAccess->hasByName("ppt/vbaProject.bin")); + + xDocShRef->DoClose(); +} CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2); |