summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-07 18:02:12 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-10-25 19:30:34 +0200
commit4bb6533d398cc76d7ff292a9e47dae87fac74f83 (patch)
tree6104d470627c2592624f315e8c8b32435ff5c109 /desktop/qa
parent9e3ec1b50052e687d6bc79db8e2ed5ebbd0eb24a (diff)
use pull model also for LOK text selection
Make LOK_CALLBACK_TEXT_SELECTION, LOK_CALLBACK_TEXT_SELECTION_START, LOK_CALLBACK_TEXT_SELECTION_END and LOK_CALLBACK_TEXT_VIEW_SELECTION also use pull model, i.e. LO core will only set a flag and when CallbackFlushHandler needs the actual data it'll use getLOKPayload(). This again avoids a large number of messages passed to CallbackFlushHandler only for them to be sooner or later discarded. Change-Id: Ia7528039be996a6e9e8491b4eba3f4133582fa56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124146 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index cfa8e039a5d0..1144a5e48369 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1545,6 +1545,7 @@ void DesktopLOKTest::testNotificationCompression()
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, ""); // 0
handler->queue(LOK_CALLBACK_TEXT_SELECTION, "15, 25, 15, 10"); // Superseded.
@@ -1640,6 +1641,7 @@ void DesktopLOKTest::testTileInvalidationCompression()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
@@ -1660,6 +1662,7 @@ void DesktopLOKTest::testTileInvalidationCompression()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 200, 200, 1"); // Different part
@@ -1683,6 +1686,7 @@ void DesktopLOKTest::testTileInvalidationCompression()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0"); // 0
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 200, 200, 1"); // 1: Different part
@@ -1709,6 +1713,7 @@ void DesktopLOKTest::testTileInvalidationCompression()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 200, 200, 0"); // 0
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 100, 100, 1"); // 1: Different part
@@ -1744,6 +1749,7 @@ void DesktopLOKTest::testTileInvalidationCompression()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "0, 0, 239, 239, 0");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "EMPTY, 0");
@@ -1768,6 +1774,7 @@ void DesktopLOKTest::testPartInInvalidation()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "10, 10, 20, 10");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "20, 10, 20, 10");
@@ -1783,6 +1790,7 @@ void DesktopLOKTest::testPartInInvalidation()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "10, 10, 20, 10");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "40, 10, 20, 10");
@@ -1802,6 +1810,7 @@ void DesktopLOKTest::testPartInInvalidation()
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "10, 10, 20, 10, 0");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "20, 10, 20, 10, 0");
@@ -1820,6 +1829,7 @@ void DesktopLOKTest::testPartInInvalidation()
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "10, 10, 20, 10, 0");
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, "20, 10, 20, 10, 1");
@@ -1848,6 +1858,7 @@ void DesktopLOKTest::testBinaryCallback()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->queue(LOK_CALLBACK_INVALIDATE_TILES, rect1String.c_str());
@@ -1860,6 +1871,7 @@ void DesktopLOKTest::testBinaryCallback()
{
std::vector<std::tuple<int, std::string>> notifs;
std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, &notifs));
+ handler->setViewId(SfxLokHelper::getView());
handler->libreOfficeKitViewInvalidateTilesCallback(&rect1, INT_MIN);