diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-01-27 17:39:10 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-02-18 00:51:02 +0100 |
commit | 7870e90da5bf4de44cfa82209ba06cd4d1cfb1a2 (patch) | |
tree | 1379702d5660c33c5e6460d4e6bb12cc8d379bd3 /desktop | |
parent | a3dccb818902756dd1dcd818c153345a0b48abf6 (diff) |
lok: Allow to edit comment by postit id
Change-Id: Ice1d40b7813226fe99c423047392b3416d763dd4
Reviewed-on: https://gerrit.libreoffice.org/33614
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 8a7c459f6afb7b8f1f622a61230a0a4411a417ac)
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index a0338f2a98bc..c8ebbae5f8d5 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1942,6 +1942,20 @@ void DesktopLOKTest::testCommentsCallbacks() CPPUNIT_ASSERT_EQUAL(std::string("Reply comment"), aView2.m_aCommentCallbackResult.get<std::string>("text")); int nCommentId2 = aView1.m_aCommentCallbackResult.get<int>("id"); + // Edit the previously added comment + aCommandArgs = "{ \"Id\": { \"type\": \"long\", \"value\": \"" + OString::number(nCommentId2) + "\" }, \"Text\": { \"type\": \"string\", \"value\": \"Edited comment\" } }"; + pDocument->pClass->postUnoCommand(pDocument, ".uno:EditAnnotation", aCommandArgs.getStr(), false); + Scheduler::ProcessEventsToIdle(); + + // We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action + CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView1.m_aCommentCallbackResult.get<std::string>("action")); + CPPUNIT_ASSERT_EQUAL(std::string("Modify"), aView2.m_aCommentCallbackResult.get<std::string>("action")); + // parent is unchanged still + CPPUNIT_ASSERT_EQUAL(nCommentId1, aView1.m_aCommentCallbackResult.get<int>("parent")); + CPPUNIT_ASSERT_EQUAL(nCommentId1, aView2.m_aCommentCallbackResult.get<int>("parent")); + CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView1.m_aCommentCallbackResult.get<std::string>("text")); + CPPUNIT_ASSERT_EQUAL(std::string("Edited comment"), aView2.m_aCommentCallbackResult.get<std::string>("text")); + // Delete the reply comment just added aCommandArgs = "{ \"Id\": { \"type\": \"long\", \"value\": \"" + OString::number(nCommentId2) + "\" } }"; pDocument->pClass->postUnoCommand(pDocument, ".uno:DeleteComment", aCommandArgs.getStr(), false); |