diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-11-26 21:55:41 -0500 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2016-11-27 16:44:33 +0000 |
commit | f80140bf3a4fa2d809167825ee04ffd0a0c19c6c (patch) | |
tree | df2aca8616460728197055e57fb92ef25f03c989 /desktop/qa | |
parent | 79b9aa430b0a9846fdcb9d5e5160559c5b2a0eba (diff) |
Lok: compress duplicate state-changed events
STATE_CHANGED callback events that have the form
of name=value are only removed when newer ones
are identical. This is not very helpful since
often the same name (i.e. state type) changes
its value and we need to superseed older ones
with new values.
This patch makes sure that a STATE_CHANGED with
a given name has its latest value and doesn't
change multiple times while in the queue.
Change-Id: Ibfa18359464d7137411e5846b1c6d415a0aad43d
Reviewed-on: https://gerrit.libreoffice.org/31258
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.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 308492b4d983..93ad652c1d8b 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1318,13 +1318,15 @@ void DesktopLOKTest::testNotificationCompression() handler->queue(LOK_CALLBACK_CELL_CURSOR, "15 25 15 10"); // Should be dropped. handler->queue(LOK_CALLBACK_CELL_FORMULA, "blah"); // 12 handler->queue(LOK_CALLBACK_SET_PART, "1"); // 13 + handler->queue(LOK_CALLBACK_STATE_CHANGED, ".uno:AssignLayout=20"); // Superseeded 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. + handler->queue(LOK_CALLBACK_STATE_CHANGED, ".uno:AssignLayout=1"); // 14 Scheduler::ProcessEventsToIdle(); - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(13), notifs.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), notifs.size()); size_t i = 0; CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, (int)std::get<0>(notifs[i])); @@ -1365,6 +1367,9 @@ void DesktopLOKTest::testNotificationCompression() CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_SET_PART, (int)std::get<0>(notifs[i])); CPPUNIT_ASSERT_EQUAL(std::string("1"), std::get<1>(notifs[i++])); + + CPPUNIT_ASSERT_EQUAL((int)LOK_CALLBACK_STATE_CHANGED, (int)std::get<0>(notifs[i])); + CPPUNIT_ASSERT_EQUAL(std::string(".uno:AssignLayout=1"), std::get<1>(notifs[i++])); } void DesktopLOKTest::testPartInInvalidation() |