diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-17 18:50:04 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-09-17 19:08:15 +0200 |
commit | a3ef3b658dea9b59ded319f2f092e73e4deaad24 (patch) | |
tree | 68cb8593ccf82de6dc1f4036ee74e10035ff9e48 /sd | |
parent | bcf8dc3d9b9d2df6f6a67c71efc52630ff65371b (diff) |
bnc#591147: unit test for media files import
Change-Id: Ie45818c54d756628e9cbc2619e5ad43cedcac92c
Diffstat (limited to 'sd')
-rw-r--r--[-rwxr-xr-x] | sd/qa/unit/data/pptx/bnc480256.pptx | bin | 35990 -> 35990 bytes | |||
-rw-r--r-- | sd/qa/unit/data/pptx/bnc591147.pptx | bin | 0 -> 34591 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 37 |
3 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/bnc480256.pptx b/sd/qa/unit/data/pptx/bnc480256.pptx Binary files differindex 71e91c2f4581..71e91c2f4581 100755..100644 --- a/sd/qa/unit/data/pptx/bnc480256.pptx +++ b/sd/qa/unit/data/pptx/bnc480256.pptx diff --git a/sd/qa/unit/data/pptx/bnc591147.pptx b/sd/qa/unit/data/pptx/bnc591147.pptx Binary files differnew file mode 100644 index 000000000000..afa382e65770 --- /dev/null +++ b/sd/qa/unit/data/pptx/bnc591147.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 91fec0f1998e..6bc206a5b304 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -77,6 +77,7 @@ public: void testBnc870237(); void testBnc887225(); void testBnc480256(); + void testBnc591147(); void testCreationDate(); void testBnc584721_1(); void testBnc584721_2(); @@ -102,6 +103,7 @@ public: CPPUNIT_TEST(testBnc870237); CPPUNIT_TEST(testBnc887225); CPPUNIT_TEST(testBnc480256); + CPPUNIT_TEST(testBnc591147); CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testBnc584721_1); CPPUNIT_TEST(testBnc584721_2); @@ -773,6 +775,41 @@ void SdFiltersTest::testBnc584721_3() xDocShRef->DoClose(); } +void SdFiltersTest::testBnc591147() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc591147.pptx"), PPTX); + + // In the document, there are two slides with media files. + uno::Reference< drawing::XDrawPagesSupplier > xDoc( + xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(2), xDoc->getDrawPages()->getCount() ); + + // First page has video file inserted + uno::Reference< drawing::XDrawPage > xPage( + xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xPage->getCount() ); + + uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY_THROW ); + OUString sVideoURL("emptyURL"); + bool bSucess = xPropSet->getPropertyValue("MediaURL") >>= sVideoURL; + CPPUNIT_ASSERT_MESSAGE( "MediaURL property is not set", bSucess ); + + // Second page has audio file inserted + xPage.set( xDoc->getDrawPages()->getByIndex(1), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xPage->getCount() ); + + xShape.set( xPage->getByIndex(0), uno::UNO_QUERY_THROW ); + xPropSet.set( xShape, uno::UNO_QUERY_THROW ); + OUString sAudioURL("emptyURL"); + bSucess = xPropSet->getPropertyValue("MediaURL") >>= sAudioURL; + CPPUNIT_ASSERT_MESSAGE( "MediaURL property is not set", bSucess ); + + CPPUNIT_ASSERT_MESSAGE( "sAudioURL and sVideoURL should not be equal", sAudioURL != sVideoURL ); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest); CPPUNIT_PLUGIN_IMPLEMENT(); |