diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-02-23 10:59:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-02-23 13:44:05 +0000 |
commit | b352c9a79ce12daf8e38246993bc821944779b0a (patch) | |
tree | f9c2f1b922739baa4ab7bf974a0fbac800eb4777 /sw | |
parent | fce77173646392847055745c6342704eb6e500a9 (diff) |
CppunitTest_sw_uiwriter8: fix sometimes failing testTdf133490
This usually passes, but if I have an other build ongoing, then
sometimes fails with:
equality assertion failed
- Expected: -139
- Actual : 1528
Fix this by doing a sync UNO call instead of async dispatch of an UNO
command. Now this test passed for me 10 times in a row under load.
Change-Id: I4f81d036c0edd3ec9467cd483238a1f32876dc50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147506
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter8.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index c9d8384fec5b..6f659480a96c 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -18,6 +18,7 @@ #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include <comphelper/propertysequence.hxx> #include <boost/property_tree/json_parser.hpp> #include <frameformats.hxx> @@ -1883,8 +1884,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133490) aPos[1] = xShape2->getPosition(); //select shape 2 and move it to the right - dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {}); - dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {}); + SwXTextDocument* pXTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + uno::Reference<view::XSelectionSupplier> xSelectionSupplier( + pXTextDocument->getCurrentController(), uno::UNO_QUERY); + xSelectionSupplier->select(uno::Any(getShape(2))); for (sal_Int32 i = 0; i < 5; ++i) { |