summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-20 11:32:17 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-10-22 15:54:02 +0200
commit62f47c26ad096cf088b545f10e14f9d81e2f2cc1 (patch)
tree3e3e70e924b4075adb9b351042f658e132d1c4bc /sw
parent9037e42ab3c3793341b583b181617185aefcbde5 (diff)
properly flush LOK invalidations in tests
This should be done always before doing something with a flag related to the invalidations. Use an idle timer for simplicity, tests already usually process to idle. Change-Id: I979900da28061cc690ecbcce023dbb769239f205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124003 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 2bc101923b41..7dab608c6323 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -444,7 +444,7 @@ void SwTiledRenderingTest::testRegisterCallback()
pWrtShell->GetSfxViewShell()->setLibreOfficeKitViewCallback(&m_callbackWrapper);
// Insert a character at the beginning of the document.
pWrtShell->Insert("x");
- pWrtShell->GetSfxViewShell()->flushPendingLOKInvalidateTiles();
+ Scheduler::ProcessEventsToIdle();
// Check that the top left 256x256px tile would be invalidated.
CPPUNIT_ASSERT(!m_aInvalidation.IsEmpty());
@@ -863,11 +863,6 @@ namespace {
mpViewShell->setLibreOfficeKitViewCallback(nullptr);
}
- void flushPendingLOKInvalidateTiles()
- {
- mpViewShell->flushPendingLOKInvalidateTiles();
- }
-
static void callback(int nType, const char* pPayload, void* pData)
{
static_cast<ViewCallback*>(pData)->callbackImpl(nType, pPayload);
@@ -1044,13 +1039,12 @@ void SwTiledRenderingTest::testMissingInvalidation()
pWrtShell->SelWrd();
// Now delete the selected word and make sure both views are invalidated.
+ Scheduler::ProcessEventsToIdle();
aView1.m_bTilesInvalidated = false;
aView2.m_bTilesInvalidated = false;
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::DELETE);
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::DELETE);
Scheduler::ProcessEventsToIdle();
- aView1.flushPendingLOKInvalidateTiles();
- aView2.flushPendingLOKInvalidateTiles();
CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
CPPUNIT_ASSERT(aView2.m_bTilesInvalidated);
}
@@ -1262,6 +1256,7 @@ void SwTiledRenderingTest::testUndoInvalidations()
CPPUNIT_ASSERT_EQUAL(OUString("Aaa bbb.c"), pShellCursor->GetPoint()->nNode.GetNode().GetTextNode()->GetText());
// Undo and assert that both views are invalidated.
+ Scheduler::ProcessEventsToIdle();
aView1.m_bTilesInvalidated = false;
aView2.m_bTilesInvalidated = false;
comphelper::dispatchCommand(".uno:Undo", {});
@@ -1739,7 +1734,6 @@ void SwTiledRenderingTest::testCommentEndTextEdit()
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RETURN);
pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RETURN);
Scheduler::ProcessEventsToIdle();
- aView1.flushPendingLOKInvalidateTiles();
CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
}