desktop/inc/lib/init.hxx | 4 ++++ desktop/qa/desktop_lib/test_desktop_lib.cxx | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-)
New commits: commit a9771e1f4d0d2602713983ab1f3e743784e9ae72 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sat Apr 30 10:55:23 2016 -0400 More LOK callback notification compression SET_PART, CELL_CURSOR, CELL_FORMULA, and CURSOR_VISIBLE are now deduplicated. Change-Id: I4c17307c6f8b7c68bdfe55b4e90da4d34c55d085 Reviewed-on: https://gerrit.libreoffice.org/24565 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index c9e0ff5..8ef92b1 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -45,6 +45,10 @@ namespace desktop { m_states.emplace(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, "NIL"); m_states.emplace(LOK_CALLBACK_STATE_CHANGED, "NIL"); m_states.emplace(LOK_CALLBACK_MOUSE_POINTER, "NIL"); + m_states.emplace(LOK_CALLBACK_CELL_CURSOR, "NIL"); + m_states.emplace(LOK_CALLBACK_CELL_FORMULA, "NIL"); + m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL"); + m_states.emplace(LOK_CALLBACK_SET_PART, "NIL"); Start(); } diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 1199fe7..9527acb 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -709,10 +709,18 @@ void DesktopLOKTest::testNotificationCompression() handler->queue(LOK_CALLBACK_TEXT_SELECTION, ""); // 12 handler->queue(LOK_CALLBACK_TEXT_SELECTION_START, "15 25 15 10"); // 13 handler->queue(LOK_CALLBACK_TEXT_SELECTION_END, "15 25 15 10"); // 14 + handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // 15 + handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // 16 + handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // Should be dropped. + handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // 17 + handler->queue(LOK_CALLBACK_SET_PART, "1"); // 18 + handler->queue(LOK_CALLBACK_CURSOR_VISIBLE, ""); // Should be dropped. + handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // Should be dropped. + handler->queue(LOK_CALLBACK_SET_PART, "1"); // Should be dropped. flushTimers(); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(15), notifs.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(19), notifs.size()); CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, (int)std::get<0>(notifs[0])); CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[0])); @@ -758,6 +766,18 @@ void DesktopLOKTest::testNotificationCompression() CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_TEXT_SELECTION_END, (int)std::get<0>(notifs[14])); CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[14])); + + CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CELL_CURSOR, (int)std::get<0>(notifs[15])); + CPPUNIT_ASSERT_EQUAL(std::string("15 25 15 10"), std::get<1>(notifs[15])); + + CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CURSOR_VISIBLE, (int)std::get<0>(notifs[16])); + CPPUNIT_ASSERT_EQUAL(std::string(""), std::get<1>(notifs[16])); + + CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_CELL_FORMULA, (int)std::get<0>(notifs[17])); + CPPUNIT_ASSERT_EQUAL(std::string("blah"), std::get<1>(notifs[17])); + + CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_SET_PART, (int)std::get<0>(notifs[18])); + CPPUNIT_ASSERT_EQUAL(std::string("1"), std::get<1>(notifs[18])); } CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits