[Libreoffice-commits] core.git: desktop/qa

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 22 07:27:21 UTC 2020


 desktop/qa/desktop_lib/test_desktop_lib.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit ffb4ce52ea32fbaf4944a5b5072d6385eccf3cb3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Apr 21 11:57:47 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Apr 22 09:26:46 2020 +0200

    Make hide lok dialog test reliable
    
    On slower machines actions were reported in different order
    
    Change-Id: I8effea3a9d114ffb0e9ebed2c18fde046490fe07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92615
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index e699f797c290..c243b75a25f8 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1871,6 +1871,7 @@ public:
     tools::Rectangle m_aOwnCursor;
     boost::property_tree::ptree m_aCommentCallbackResult;
     boost::property_tree::ptree m_aCallbackWindowResult;
+    bool m_bWindowHidden;
 
     ViewCallback(LibLODocument_Impl* pDocument)
         : mpDocument(pDocument),
@@ -1926,6 +1927,10 @@ public:
             m_aCallbackWindowResult.clear();
             std::stringstream aStream(pPayload);
             boost::property_tree::read_json(aStream, m_aCallbackWindowResult);
+
+            std::string sAction = m_aCallbackWindowResult.get<std::string>("action");
+            if (sAction == "hide")
+                m_bWindowHidden = true;
         }
         break;
         case LOK_CALLBACK_CELL_FORMULA:
@@ -2666,15 +2671,15 @@ void DesktopLOKTest::testShowHideDialog()
     VclPtr<vcl::Window> pWindow(Application::GetActiveTopWindow());
     CPPUNIT_ASSERT(pWindow);
 
+    aView.m_bWindowHidden = false;
+
     pWindow->Hide();
     Scheduler::ProcessEventsToIdle();
 
-    CPPUNIT_ASSERT_EQUAL(std::string("hide"), aView.m_aCallbackWindowResult.get<std::string>("action"));
+    CPPUNIT_ASSERT_EQUAL(true, aView.m_bWindowHidden);
 
-    pWindow->Show();
+    static_cast<SystemWindow*>(pWindow.get())->Close();
     Scheduler::ProcessEventsToIdle();
-
-    CPPUNIT_ASSERT_EQUAL(std::string("invalidate"), aView.m_aCallbackWindowResult.get<std::string>("action"));
 }
 
 void DesktopLOKTest::testComplexSelection()


More information about the Libreoffice-commits mailing list