summaryrefslogtreecommitdiff
path: root/vcl/osx/service_entry.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-02-24 19:31:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-26 10:00:44 +0100
commit043c67e0f7358753a2007b7c2bb6cc68aeea7ecb (patch)
tree8a86daf82dfdce20090ff4ddc6d88eafe2af49a0 /vcl/osx/service_entry.cxx
parent9c1ec551524a75c20c1468a6fc0101eb2480e8e3 (diff)
dummy clipboard for unit tests
Change-Id: I285b36536dd38e41a199e8b6fd654666d125d906 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111498 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'vcl/osx/service_entry.cxx')
-rw-r--r--vcl/osx/service_entry.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/osx/service_entry.cxx b/vcl/osx/service_entry.cxx
index eebb675ce9d2..4263735422e7 100644
--- a/vcl/osx/service_entry.cxx
+++ b/vcl/osx/service_entry.cxx
@@ -34,9 +34,13 @@ using namespace ::cppu;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
+// We run unit tests in parallel, which is a problem when touching a shared resource
+// the system clipboard, so rather use the dummy GenericClipboard.
+static const bool bRunningUnitTest = getenv("LO_TESTNAME");
+
uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< Any >& i_rArguments )
{
- if ( Application::IsHeadlessModeEnabled() )
+ if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
return SalInstance::CreateClipboard( i_rArguments );
SalData* pSalData = GetSalData();
@@ -47,7 +51,7 @@ uno::Reference< XInterface > AquaSalInstance::CreateClipboard( const Sequence< A
uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
{
- if ( Application::IsHeadlessModeEnabled() )
+ if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
return SalInstance::CreateDragSource();
return uno::Reference<XInterface>(static_cast< XInitialization* >(new DragSource()), UNO_QUERY);
@@ -55,7 +59,7 @@ uno::Reference<XInterface> AquaSalInstance::CreateDragSource()
uno::Reference<XInterface> AquaSalInstance::CreateDropTarget()
{
- if ( Application::IsHeadlessModeEnabled() )
+ if ( Application::IsHeadlessModeEnabled() || bRunningUnitTest )
return SalInstance::CreateDropTarget();
return uno::Reference<XInterface>(static_cast< XInitialization* >(new DropTarget()), UNO_QUERY);