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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 2 13:43:20 UTC 2020


 desktop/qa/desktop_lib/test_desktop_lib.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 4959e6a1054e8c1f08ef2068b522f06b432ceb45
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Mar 30 19:38:31 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu Apr 2 15:42:48 2020 +0200

    lok: unit test GetControlState
    
    Change-Id: I7187fe787aaed33d85ad76b612725741e9f586d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91383
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 101fdda65742..3ca8c555544a 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -50,6 +50,7 @@
 #include <config_features.h>
 
 #include <lib/init.hxx>
+#include <svx/svxids.hrc>
 
 using namespace com::sun::star;
 using namespace desktop;
@@ -171,6 +172,7 @@ public:
     void testDialogPaste();
     void testCalcSaveAs();
     void testDialogInput();
+    void testControlState();
     void testABI();
 
     CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -227,6 +229,7 @@ public:
     CPPUNIT_TEST(testDialogPaste);
     CPPUNIT_TEST(testCalcSaveAs);
     CPPUNIT_TEST(testDialogInput);
+    CPPUNIT_TEST(testControlState);
     CPPUNIT_TEST(testABI);
     CPPUNIT_TEST_SUITE_END();
 
@@ -2772,6 +2775,19 @@ void DesktopLOKTest::testSpellcheckerMultiView()
     CPPUNIT_ASSERT_EQUAL(1, pDocument->m_pDocumentClass->getViewsCount(pDocument));
 }
 
+void DesktopLOKTest::testControlState()
+{
+    LibLODocument_Impl* pDocument = loadDoc("search.ods");
+    pDocument->pClass->postUnoCommand(pDocument, ".uno:StarShapes", nullptr, false);
+    Scheduler::ProcessEventsToIdle();
+
+    boost::property_tree::ptree aState;
+    SfxViewShell* pViewShell = SfxViewShell::Current();
+    pViewShell->GetViewFrame()->GetBindings().Update();
+    pViewShell->GetViewFrame()->GetBindings().QueryControlState(SID_ATTR_TRANSFORM_WIDTH, aState);
+    CPPUNIT_ASSERT(!aState.empty());
+}
+
 namespace {
 
 constexpr size_t classOffset(int i)


More information about the Libreoffice-commits mailing list