Kaydet (Commit) a3ef3b65 authored tarafından Matúš Kukan's avatar Matúš Kukan

bnc#591147: unit test for media files import

Change-Id: Ie45818c54d756628e9cbc2619e5ad43cedcac92c
üst bcf8dc3d
File mode changed from 100755 to 100644
...@@ -77,6 +77,7 @@ public: ...@@ -77,6 +77,7 @@ public:
void testBnc870237(); void testBnc870237();
void testBnc887225(); void testBnc887225();
void testBnc480256(); void testBnc480256();
void testBnc591147();
void testCreationDate(); void testCreationDate();
void testBnc584721_1(); void testBnc584721_1();
void testBnc584721_2(); void testBnc584721_2();
...@@ -102,6 +103,7 @@ public: ...@@ -102,6 +103,7 @@ public:
CPPUNIT_TEST(testBnc870237); CPPUNIT_TEST(testBnc870237);
CPPUNIT_TEST(testBnc887225); CPPUNIT_TEST(testBnc887225);
CPPUNIT_TEST(testBnc480256); CPPUNIT_TEST(testBnc480256);
CPPUNIT_TEST(testBnc591147);
CPPUNIT_TEST(testCreationDate); CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST(testBnc584721_1); CPPUNIT_TEST(testBnc584721_1);
CPPUNIT_TEST(testBnc584721_2); CPPUNIT_TEST(testBnc584721_2);
...@@ -773,6 +775,41 @@ void SdFiltersTest::testBnc584721_3() ...@@ -773,6 +775,41 @@ void SdFiltersTest::testBnc584721_3()
xDocShRef->DoClose(); 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_TEST_SUITE_REGISTRATION(SdFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment