summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 10:42:43 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 12:49:06 +0100
commit81791adc414adcaa9f43b5f449ad0f6752e01df7 (patch)
treec208879d2b8c3bd738b4bd823d89b59ca4533ac7 /slideshow
parent25245dba23def7391f3c0c82f7e804674a89a876 (diff)
CppunitTest_slideshow_engine: inherit from UnoApiTest
Change-Id: Id945ba8b9c7943c07063cb9456981ce542f61347 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143096 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/CppunitTest_slideshow_engine.mk4
-rw-r--r--slideshow/qa/engine/engine.cxx35
2 files changed, 12 insertions, 27 deletions
diff --git a/slideshow/CppunitTest_slideshow_engine.mk b/slideshow/CppunitTest_slideshow_engine.mk
index a88531df49f7..d9a88a980f17 100644
--- a/slideshow/CppunitTest_slideshow_engine.mk
+++ b/slideshow/CppunitTest_slideshow_engine.mk
@@ -23,9 +23,13 @@ $(eval $(call gb_CppunitTest_use_libraries,slideshow_engine, \
comphelper \
cppu \
slideshow \
+ cppuhelper \
sal \
+ subsequenttest \
test \
unotest \
+ utl \
+ tl \
))
$(eval $(call gb_CppunitTest_use_sdk_api,slideshow_engine))
diff --git a/slideshow/qa/engine/engine.cxx b/slideshow/qa/engine/engine.cxx
index bdc60b71bab1..f2d3f12121d3 100644
--- a/slideshow/qa/engine/engine.cxx
+++ b/slideshow/qa/engine/engine.cxx
@@ -7,8 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <test/bootstrapfixture.hxx>
-#include <unotest/macros_test.hxx>
+#include <test/unoapi_test.hxx>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
@@ -22,32 +21,15 @@ using namespace ::com::sun::star;
namespace
{
/// Covers slideshow/source/engine/ fixes.
-class Test : public test::BootstrapFixture, public unotest::MacrosTest
+class Test : public UnoApiTest
{
-private:
- uno::Reference<lang::XComponent> mxComponent;
-
public:
- void setUp() override;
- void tearDown() override;
- uno::Reference<lang::XComponent>& getComponent() { return mxComponent; }
+ Test()
+ : UnoApiTest("slideshow/qa/engine/data/")
+ {
+ }
};
-void Test::setUp()
-{
- test::BootstrapFixture::setUp();
-
- mxDesktop.set(frame::Desktop::create(mxComponentContext));
-}
-
-void Test::tearDown()
-{
- if (mxComponent.is())
- mxComponent->dispose();
-
- test::BootstrapFixture::tearDown();
-}
-
/// Get the first command node in the animation tree of the page, assuming that it's the first child
/// (recursively).
uno::Reference<animations::XCommand>
@@ -75,9 +57,8 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation)
{
// Given a document with a looping video, the looping is defined as part of its auto-play
// animation (and not on the media shape):
- OUString aURL = m_directories.getURLFromSrc(u"slideshow/qa/engine/data/video-loop.pptx");
- getComponent().set(loadFromDesktop(aURL));
- uno::Reference<drawing::XDrawPagesSupplier> xDoc(getComponent(), uno::UNO_QUERY);
+ loadFromURL(u"video-loop.pptx");
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
uno::Reference<animations::XCommand> xCommandNode = GetFirstCommandNodeOfPage(xPage);
uno::Reference<drawing::XShape> xShape(xPage->getByIndex(0), uno::UNO_QUERY);