[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/qa

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 15 23:52:26 UTC 2019


 sw/qa/extras/tiledrendering/tiledrendering.cxx |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

New commits:
commit e17fdacc1a91d40f829aaa1ae075142d23803340
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Apr 16 09:01:01 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Sat Nov 16 00:51:18 2019 +0100

    sw lok: add unit test for deselect custom shape
    
    Change-Id: I41a9ff0d281d9032ddaafbbcb55352254a809efe
    Reviewed-on: https://gerrit.libreoffice.org/70824
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/70880
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/82518
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index bbc91370dc2d..110a6ffff16f 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -118,6 +118,7 @@ public:
     void testSemiTransparent();
     void testAnchorTypes();
     void testLanguageStatus();
+    void testDeselectCustomShape();
     void testHyperlink();
 
     CPPUNIT_TEST_SUITE(SwTiledRenderingTest);
@@ -179,6 +180,7 @@ public:
     CPPUNIT_TEST(testSemiTransparent);
     CPPUNIT_TEST(testAnchorTypes);
     CPPUNIT_TEST(testLanguageStatus);
+    CPPUNIT_TEST(testDeselectCustomShape);
     CPPUNIT_TEST(testHyperlink);
     CPPUNIT_TEST_SUITE_END();
 
@@ -2559,6 +2561,27 @@ void SwTiledRenderingTest::testLanguageStatus()
     CPPUNIT_ASSERT_EQUAL(OUString("English (USA);en-US"), aList[0]);
 }
 
+void SwTiledRenderingTest::testDeselectCustomShape()
+{
+    comphelper::LibreOfficeKit::setActive();
+
+    SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
+    SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+    SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false);
+    Point aStart = pShellCursor->GetSttPos();
+    aStart.setX(aStart.getX() - 1000);
+    aStart.setY(aStart.getY() - 1000);
+
+    comphelper::dispatchCommand(".uno:BasicShapes.hexagon", uno::Sequence<beans::PropertyValue>());
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount());
+
+    pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, aStart.getX(), aStart.getY(), 1, MOUSE_LEFT, 0);
+    pXTextDocument->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, aStart.getX(), aStart.getY(), 1, MOUSE_LEFT, 0);
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pWrtShell->GetDrawView()->GetMarkedObjectList().GetMarkCount());
+}
+
 void SwTiledRenderingTest::testHyperlink()
 {
     comphelper::LibreOfficeKit::setActive();
@@ -2580,6 +2603,7 @@ void SwTiledRenderingTest::testHyperlink()
     CPPUNIT_ASSERT_EQUAL(OString("http://example.com/"), m_sHyperlinkLink);
 }
 
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwTiledRenderingTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list