From 70a84bc0ee414a67b1dfb5f4055b337ca777b2b6 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 22 Nov 2022 11:07:23 +0100 Subject: CppunitTest_framework_services: inherit from UnoApiTest Change-Id: I8963f0dbf5e70347ee98e639dc6eeecc0f43b821 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143099 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- framework/CppunitTest_framework_services.mk | 3 +++ framework/qa/cppunit/services.cxx | 32 +++++++---------------------- 2 files changed, 10 insertions(+), 25 deletions(-) (limited to 'framework') diff --git a/framework/CppunitTest_framework_services.mk b/framework/CppunitTest_framework_services.mk index f098b7e0bcf9..2e6e4a50a37f 100644 --- a/framework/CppunitTest_framework_services.mk +++ b/framework/CppunitTest_framework_services.mk @@ -21,8 +21,11 @@ $(eval $(call gb_CppunitTest_use_libraries,framework_services, \ cppuhelper \ sal \ salhelper \ + subsequenttest \ test \ unotest \ + utl \ + tl \ vcl \ )) diff --git a/framework/qa/cppunit/services.cxx b/framework/qa/cppunit/services.cxx index 873ea5938e4c..74ef3b663a66 100644 --- a/framework/qa/cppunit/services.cxx +++ b/framework/qa/cppunit/services.cxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include -#include +#include #include #include @@ -27,32 +26,15 @@ using namespace ::com::sun::star; namespace { /// Covers framework/source/services/ fixes. -class Test : public test::BootstrapFixture, public unotest::MacrosTest +class Test : public UnoApiTest { -protected: - uno::Reference mxComponent; - public: - void setUp() override; - void tearDown() override; - uno::Reference& getComponent() { return mxComponent; } + Test() + : UnoApiTest("/framework/qa/cppunit/data/") + { + } }; -void Test::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void Test::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - /// Invokes XFrameImpl::loadComponentFromURL() on a thread. class TestThread : public salhelper::Thread { @@ -106,7 +88,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLoadComponentFromURL) SolarMutexGuard guard; uno::Reference xFrame = mxDesktop->findFrame("_blank", /*nSearchFlags=*/0); uno::Reference xComponentLoader(xFrame, uno::UNO_QUERY); - xThread = new TestThread(xComponentLoader, getComponent()); + xThread = new TestThread(xComponentLoader, mxComponent); xThread->launch(); // If loadComponentFromURL() doesn't lock the solar mutex, the test will abort here. osl::Thread::wait(std::chrono::seconds(1)); -- cgit