summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-04-03 20:50:59 +0200
committerroot <root@linux-3qg3.site>2014-04-04 19:06:13 +0200
commit327b0a6cc0dbc68552293c0ca9a8f61de280523e (patch)
treec93c4a445ecb8b81be63685495de1084ca900164 /sd
parent7d7e2a01a686c063f071318d8f5b9864b441db39 (diff)
ODP filter test: embedded media and glTF model
Change-Id: I2340fa5a20a5774e5db78940cf7d4dc584f09b82
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/media_embedding.odpbin0 -> 216243 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/media_embedding.odp b/sd/qa/unit/data/media_embedding.odp
new file mode 100644
index 000000000000..14ea4606448c
--- /dev/null
+++ b/sd/qa/unit/data/media_embedding.odp
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 12063c2bc312..073169a891a0 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -25,6 +25,7 @@
#include <svx/svdotext.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdogrp.hxx>
+#include <svx/svdomedia.hxx>
#include <animations/animationnodehelper.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -68,6 +69,7 @@ public:
void testN862510_3();
void testN862510_4();
void testFdo71961();
+ void testMediaEmbedding();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -90,6 +92,7 @@ public:
CPPUNIT_TEST(testN862510_3);
CPPUNIT_TEST(testN862510_4);
CPPUNIT_TEST(testFdo71961);
+ CPPUNIT_TEST(testMediaEmbedding);
CPPUNIT_TEST_SUITE_END();
};
@@ -678,6 +681,29 @@ void SdFiltersTest::testFdo71961()
xDocShRef->DoClose();
}
+void SdFiltersTest::testMediaEmbedding()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/media_embedding.odp"));
+ xDocShRef = saveAndReload( xDocShRef, ODP );
+
+ SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+ const SdrPage *pPage = pDoc->GetPage (1);
+ CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+
+ // First object is a glTF model
+ SdrMediaObj *pModelObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 1 ));
+ CPPUNIT_ASSERT_MESSAGE( "missing model", pModelObj != NULL);
+ CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Model/duck/duck.json" ), pModelObj->getMediaProperties().getURL());
+ CPPUNIT_ASSERT_EQUAL( OUString( "application/vnd.gltf+json" ), pModelObj->getMediaProperties().getMimeType());
+
+ // Second object is a sound
+ SdrMediaObj *pMediaObj = dynamic_cast<SdrMediaObj*>( pPage->GetObj( 2 ));
+ CPPUNIT_ASSERT_MESSAGE( "missing media object", pMediaObj != NULL);
+ CPPUNIT_ASSERT_EQUAL( OUString( "vnd.sun.star.Package:Media/button-1.wav" ), pMediaObj->getMediaProperties().getURL());
+ CPPUNIT_ASSERT_EQUAL( OUString( "application/vnd.sun.star.media" ), pMediaObj->getMediaProperties().getMimeType());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();