summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-17 18:50:04 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-09-17 19:08:15 +0200
commita3ef3b658dea9b59ded319f2f092e73e4deaad24 (patch)
tree68cb8593ccf82de6dc1f4036ee74e10035ff9e48 /sd
parentbcf8dc3d9b9d2df6f6a67c71efc52630ff65371b (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.pptxbin35990 -> 35990 bytes
-rw-r--r--sd/qa/unit/data/pptx/bnc591147.pptxbin0 -> 34591 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx37
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
index 71e91c2f4581..71e91c2f4581 100755..100644
--- a/sd/qa/unit/data/pptx/bnc480256.pptx
+++ b/sd/qa/unit/data/pptx/bnc480256.pptx
Binary files differ
diff --git a/sd/qa/unit/data/pptx/bnc591147.pptx b/sd/qa/unit/data/pptx/bnc591147.pptx
new file mode 100644
index 000000000000..afa382e65770
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc591147.pptx
Binary files differ
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();