[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/qa
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 20 22:47:18 UTC 2020
desktop/qa/desktop_lib/test_desktop_lib.cxx | 35 ++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
New commits:
commit 0b5527daf908d485153ff5c2c0d4d8bd34644921
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Thu May 7 16:47:36 2020 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Thu May 21 00:46:46 2020 +0200
lok: unit test for metric field or formatted field control
Change-Id: I0a3efef85ff889c4214ab326d1de96a4acd207a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93779
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94527
Tested-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 6f68380daea7..35314f0da0f3 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -27,10 +27,13 @@
#include <vcl/svapp.hxx>
#include <vcl/syswin.hxx>
#include <vcl/window.hxx>
+#include <vcl/uitest/uiobject.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/uri.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
+#include <sfx2/app.hxx>
+#include <sfx2/childwin.hxx>
#include <sfx2/lokhelper.hxx>
#include <test/unoapi_test.hxx>
#include <comphelper/lok.hxx>
@@ -151,6 +154,7 @@ public:
void testDialogInput();
void testCalcSaveAs();
void testControlState();
+ void testMetricField();
void testABI();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -210,6 +214,7 @@ public:
CPPUNIT_TEST(testDialogInput);
CPPUNIT_TEST(testCalcSaveAs);
CPPUNIT_TEST(testControlState);
+ CPPUNIT_TEST(testMetricField);
CPPUNIT_TEST(testABI);
CPPUNIT_TEST_SUITE_END();
@@ -2748,6 +2753,36 @@ void DesktopLOKTest::testControlState()
CPPUNIT_ASSERT(!aState.empty());
}
+void DesktopLOKTest::testMetricField()
+{
+ LibLODocument_Impl* pDocument = loadDoc("search.ods");
+ pDocument->pClass->postUnoCommand(pDocument, ".uno:StarShapes", nullptr, false);
+ Scheduler::ProcessEventsToIdle();
+
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
+
+ SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
+ CPPUNIT_ASSERT(pViewFrame);
+
+ SfxChildWindow* pSideBar = pViewFrame->GetChildWindow(SID_SIDEBAR);
+ CPPUNIT_ASSERT(pSideBar);
+
+ vcl::Window* pWin = pSideBar->GetWindow();
+ CPPUNIT_ASSERT(pWin);
+
+ WindowUIObject aWinUI(pWin);
+ std::unique_ptr<UIObject> pUIWin(aWinUI.get_child("selectwidth"));
+ CPPUNIT_ASSERT(pUIWin.get());
+
+ StringMap aMap;
+ aMap["VALUE"] = "75.06";
+ pUIWin->execute("VALUE", aMap);
+
+ StringMap aRet = pUIWin->get_state();
+ CPPUNIT_ASSERT_EQUAL(aMap["VALUE"], aRet["Value"]);
+}
+
namespace {
constexpr size_t classOffset(int i)
More information about the Libreoffice-commits
mailing list