diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-22 10:42:43 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-22 12:49:06 +0100 |
commit | 81791adc414adcaa9f43b5f449ad0f6752e01df7 (patch) | |
tree | c208879d2b8c3bd738b4bd823d89b59ca4533ac7 /slideshow/qa | |
parent | 25245dba23def7391f3c0c82f7e804674a89a876 (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/qa')
-rw-r--r-- | slideshow/qa/engine/engine.cxx | 35 |
1 files changed, 8 insertions, 27 deletions
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); |