diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-12-10 18:15:17 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-12-14 14:47:23 +0100 |
commit | 18470cb6bff9f682b3b86495d80e9ad54c9b5567 (patch) | |
tree | 7fffa6aa0597dba876f9f8debf505ab8cfe64ac0 /desktop/qa | |
parent | 70e6d969dcbece69bc9bd5e3a0bc5d878a33ca6a (diff) |
fix handling of the "EMPTY" LOK tile invalidation
The LOK_CALLBACK_INVALIDATE_TILES documentation says that
invalidate-all message should say "EMPTY", which wasn't converted
properly from the MaxTwips rectangle representation. Doing that
now needs also changing the testTileInvalidationCompression() test,
but that should be a fix of the test, and conceptually it should
be the same.
Change-Id: I58fcc56ee56d9f6fcdb9298938e8aa7e3609d6db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126651
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.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 5c17f880e2de..c1b1cc34cbf9 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1764,7 +1764,7 @@ void DesktopLOKTest::testTileInvalidationCompression() size_t i = 0; CPPUNIT_ASSERT_EQUAL(int(LOK_CALLBACK_INVALIDATE_TILES), std::get<0>(notifs[i])); - CPPUNIT_ASSERT_EQUAL(std::string("0, 0, 1000000000, 1000000000, 0"), std::get<1>(notifs[i++])); + CPPUNIT_ASSERT_EQUAL(std::string("EMPTY, 0"), std::get<1>(notifs[i++])); } } @@ -1855,7 +1855,7 @@ void DesktopLOKTest::testBinaryCallback() const tools::Rectangle rect1(Point(10,15),Size(20,25)); const std::string rect1String(rect1.toString().getStr()); - // Very that using queue() and libreOfficeKitViewInvalidateTilesCallback() has the same result. + // Verify that using queue() and libreOfficeKitViewInvalidateTilesCallback() has the same result. { std::vector<std::tuple<int, std::string>> notifs; std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, ¬ifs)); @@ -1882,6 +1882,20 @@ void DesktopLOKTest::testBinaryCallback() CPPUNIT_ASSERT_EQUAL(int(LOK_CALLBACK_INVALIDATE_TILES), std::get<0>(notifs[0])); CPPUNIT_ASSERT_EQUAL(rect1String, std::get<1>(notifs[0])); } + // Verify that the "EMPTY" invalidation gets converted properly. + { + std::vector<std::tuple<int, std::string>> notifs; + std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackBinaryCallbackTest, ¬ifs)); + handler->setViewId(SfxLokHelper::getView()); + + handler->libreOfficeKitViewInvalidateTilesCallback(nullptr, INT_MIN); + + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), notifs.size()); + CPPUNIT_ASSERT_EQUAL(int(LOK_CALLBACK_INVALIDATE_TILES), std::get<0>(notifs[0])); + CPPUNIT_ASSERT_EQUAL(std::string("EMPTY"), std::get<1>(notifs[0])); + } } void DesktopLOKTest::testDialogInput() |