summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 11:07:23 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-11-22 14:52:43 +0100
commit70a84bc0ee414a67b1dfb5f4055b337ca777b2b6 (patch)
treebedf7deb89c6ac1411ba42a042ef55cc995b4734 /framework
parent86545868163667d7de4c7d1ef38f16d6d47f2b45 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'framework')
-rw-r--r--framework/CppunitTest_framework_services.mk3
-rw-r--r--framework/qa/cppunit/services.cxx32
2 files changed, 10 insertions, 25 deletions
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 <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/XFrame.hpp>
@@ -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<lang::XComponent> mxComponent;
-
public:
- void setUp() override;
- void tearDown() override;
- uno::Reference<lang::XComponent>& 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<frame::XFrame> xFrame = mxDesktop->findFrame("_blank", /*nSearchFlags=*/0);
uno::Reference<frame::XComponentLoader> 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));