summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-04-19 21:26:42 -0400
committerAshod Nakashian <ashnakash@gmail.com>2016-05-07 22:19:50 +0000
commitc327bb5c88573c96f22e9a8cfc4b8a733ae6b671 (patch)
tree6d552e8c25356a33cd398170b7685eb67b397081 /desktop/qa
parent3ee2edf47a148e14937d8964847dfb46f027ce05 (diff)
New LOKDocument callback queue to flush events lazily on idle
Since desktop now queues up callback notifications and flushes them to the client on idle, the unit-tests must yield and process all tasks before they validate post-conditions. (cherry picked from commit e6a429770bde5da75239961ae88c06c78cfa5686) (cherry picked from commit 1f278848117080cd6e819f04ba428be52416af7c) (cherry picked from commit 6ca6f22777eb3651109cbf403577d0022a735c9b) (cherry picked from commit 548faf728cf097d93c3f6478ceea5f8747e789c6) Change-Id: I78307db29a9ce647ffaed3539f953227c605968e Reviewed-on: https://gerrit.libreoffice.org/24377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 93bde3decb7f..5ad6c0df8275 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -353,6 +353,7 @@ void DesktopLOKTest::testSearchCalc()
{"SearchItem.Command", uno::makeAny(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))},
}));
comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+ Scheduler::ProcessEventsToIdle();
std::vector<OString> aSelections;
sal_Int32 nIndex = 0;
@@ -635,6 +636,7 @@ void DesktopLOKTest::testCommandResult()
// the condition var.
m_aCommandResultCondition.reset();
pDocument->pClass->postUnoCommand(pDocument, ".uno:Bold", nullptr, true);
+ Scheduler::ProcessEventsToIdle();
m_aCommandResultCondition.wait(aTimeValue);
CPPUNIT_ASSERT(m_aCommandResult.isEmpty());
@@ -644,6 +646,7 @@ void DesktopLOKTest::testCommandResult()
m_aCommandResultCondition.reset();
pDocument->pClass->postUnoCommand(pDocument, ".uno:Bold", nullptr, true);
+ Scheduler::ProcessEventsToIdle();
m_aCommandResultCondition.wait(aTimeValue);
boost::property_tree::ptree aTree;
@@ -666,6 +669,7 @@ void DesktopLOKTest::testWriterComments()
TimeValue aTimeValue = {2 , 0}; // 2 seconds max
m_aCommandResultCondition.reset();
pDocument->pClass->postUnoCommand(pDocument, ".uno:InsertAnnotation", nullptr, true);
+ Scheduler::ProcessEventsToIdle();
m_aCommandResultCondition.wait(aTimeValue);
CPPUNIT_ASSERT(!m_aCommandResult.isEmpty());
xToolkit->reschedule();
@@ -706,6 +710,7 @@ void DesktopLOKTest::testModifiedStatus()
m_bModified = false;
m_aStateChangedCondition.reset();
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
+ Scheduler::ProcessEventsToIdle();
TimeValue aTimeValue = { 2 , 0 }; // 2 seconds max
m_aStateChangedCondition.wait(aTimeValue);
Scheduler::ProcessEventsToIdle();
@@ -719,6 +724,7 @@ void DesktopLOKTest::testModifiedStatus()
utl::TempFile aTempFile;
aTempFile.EnableKillingFile();
CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "odt", "TakeOwnership"));
+ Scheduler::ProcessEventsToIdle();
m_aStateChangedCondition.wait(aTimeValue);
Scheduler::ProcessEventsToIdle();
@@ -728,6 +734,7 @@ void DesktopLOKTest::testModifiedStatus()
// Modify the document again
m_aStateChangedCondition.reset();
pDocument->pClass->postKeyEvent(pDocument, LOK_KEYEVENT_KEYINPUT, 't', 0);
+ Scheduler::ProcessEventsToIdle();
m_aStateChangedCondition.wait(aTimeValue);
Scheduler::ProcessEventsToIdle();
@@ -976,6 +983,7 @@ void DesktopLOKTest::testContextMenuCalc()
LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
aPointOnImage.X(), aPointOnImage.Y(),
1, 4, 0);
+ Scheduler::ProcessEventsToIdle();
TimeValue aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);
@@ -1085,6 +1093,7 @@ void DesktopLOKTest::testContextMenuWriter()
LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
aRandomPoint.X(), aRandomPoint.Y(),
1, 4, 0);
+ Scheduler::ProcessEventsToIdle();
TimeValue aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);
@@ -1140,6 +1149,7 @@ void DesktopLOKTest::testContextMenuImpress()
LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
aRandomPoint.X(), aRandomPoint.Y(),
1, 4, 0);
+ Scheduler::ProcessEventsToIdle();
TimeValue aTimeValue = {2 , 0}; // 2 seconds max
m_aContextMenuCondition.wait(aTimeValue);