summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 11:12:39 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 13:24:58 +0100
commit49cd099df436f85be9abf97db299f54e580c5236 (patch)
tree4ea967ec39525448802bb8993d3d6803c434bda6 /framework
parent91436c281b6cbd7ca3678370afe2f9d874a4e422 (diff)
CppunitTest_framework_dispatch: inherit from UnoApiTest
Change-Id: I9a839ffe01e1d5da49268bd8ad78dbedd8dadc25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143100 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'framework')
-rw-r--r--framework/CppunitTest_framework_dispatch.mk3
-rw-r--r--framework/qa/cppunit/dispatchtest.cxx34
2 files changed, 10 insertions, 27 deletions
diff --git a/framework/CppunitTest_framework_dispatch.mk b/framework/CppunitTest_framework_dispatch.mk
index 2a239030d6d2..b9571ebe3ad4 100644
--- a/framework/CppunitTest_framework_dispatch.mk
+++ b/framework/CppunitTest_framework_dispatch.mk
@@ -21,6 +21,9 @@ $(eval $(call gb_CppunitTest_use_libraries,framework_dispatch, \
cppuhelper \
fwk \
sal \
+ subsequenttest \
+ utl \
+ tl \
test \
unotest \
))
diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx
index b0d873e61bbf..f45f0da5bf0e 100644
--- a/framework/qa/cppunit/dispatchtest.cxx
+++ b/framework/qa/cppunit/dispatchtest.cxx
@@ -8,8 +8,7 @@
*/
#include <cppuhelper/implbase.hxx>
-#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/frame/XDispatchProviderInterceptor.hpp>
@@ -133,31 +132,15 @@ uno::Reference<frame::XDispatch> MyInterceptor::queryDispatch(const util::URL& r
}
/// Tests how InterceptionHelper invokes a registered interceptor.
-class DispatchTest : public test::BootstrapFixture, public unotest::MacrosTest
+class DispatchTest : public UnoApiTest
{
-protected:
- uno::Reference<lang::XComponent> mxComponent;
-
public:
- virtual void setUp() override;
- virtual void tearDown() override;
+ DispatchTest()
+ : UnoApiTest("/framework/qa/cppunit/data/")
+ {
+ }
};
-void DispatchTest::setUp()
-{
- test::BootstrapFixture::setUp();
-
- mxDesktop.set(frame::Desktop::create(mxComponentContext));
-}
-
-void DispatchTest::tearDown()
-{
- if (mxComponent.is())
- mxComponent->dispose();
-
- test::BootstrapFixture::tearDown();
-}
-
CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
{
mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
@@ -180,13 +163,10 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testInterception)
CPPUNIT_ASSERT_EQUAL(0, pInterceptor->getUnexpected());
}
-constexpr OUStringLiteral DATA_DIRECTORY = u"/framework/qa/cppunit/data/";
-
CPPUNIT_TEST_FIXTURE(DispatchTest, testSfxOfficeDispatchDispose)
{
// this test doesn't work with a new document because of aURL.Main check in SfxBaseController::dispatch()
- mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) + "empty.fodp",
- "com.sun.star.presentation.PresentationDocument");
+ loadFromURL(u"empty.fodp");
uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xModel.is());
uno::Reference<frame::XController> xController(xModel->getCurrentController());