[Libreoffice-commits] core.git: 2 commits - include/vcl offapi/com uitest/impress_tests vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Feb 27 09:44:04 UTC 2017


 include/vcl/uitest/uitest.hxx           |    2 ++
 offapi/com/sun/star/ui/test/XUITest.idl |    2 ++
 uitest/impress_tests/drawinglayer.py    |    4 ----
 vcl/source/uitest/uitest.cxx            |   10 ++++++++++
 vcl/source/uitest/uno/uitest_uno.cxx    |    8 ++++++++
 5 files changed, 22 insertions(+), 4 deletions(-)

New commits:
commit aa10a19c8e56a51654bcb26f718f6e7187159c72
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Feb 27 04:04:26 2017 +0100

    uitest: add a specific method for executing dialogs
    
    This allows us to split the parts that need to run async and the ones
    that can run synchronous. This will reduce the number of signals that we
    need.
    
    Change-Id: I9c9f3df3422cc66d28d66e0638e212b39c743e33
    Reviewed-on: https://gerrit.libreoffice.org/34669
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/vcl/uitest/uitest.hxx b/include/vcl/uitest/uitest.hxx
index 9f226b8..53a0490 100644
--- a/include/vcl/uitest/uitest.hxx
+++ b/include/vcl/uitest/uitest.hxx
@@ -21,6 +21,8 @@ public:
 
     static void executeCommand(const OUString& rCommand);
 
+    static void executeDialog(const OUString& rCommand);
+
     static std::unique_ptr<UIObject> getFocusTopWindow();
 };
 
diff --git a/offapi/com/sun/star/ui/test/XUITest.idl b/offapi/com/sun/star/ui/test/XUITest.idl
index 87a0912..89da44c 100644
--- a/offapi/com/sun/star/ui/test/XUITest.idl
+++ b/offapi/com/sun/star/ui/test/XUITest.idl
@@ -18,6 +18,8 @@ interface XUITest
 {
     void executeCommand([in] string command);
 
+    void executeDialog([in] string command);
+
     XUIObject getTopFocusWindow();
 };
 
diff --git a/vcl/source/uitest/uitest.cxx b/vcl/source/uitest/uitest.cxx
index d876479..4484975 100644
--- a/vcl/source/uitest/uitest.cxx
+++ b/vcl/source/uitest/uitest.cxx
@@ -26,6 +26,16 @@ void UITest::executeCommand(const OUString& rCommand)
     SAL_WARN_IF(!bSuccess, "vcl.uitest", "failed to execute command: " << rCommand);
 }
 
+void UITest::executeDialog(const OUString& rCommand)
+{
+    bool bSuccess = comphelper::dispatchCommand(
+        rCommand,
+        {{"SynchronMode", -1, css::uno::Any(false),
+          css::beans::PropertyState_DIRECT_VALUE}});
+
+    SAL_WARN_IF(!bSuccess, "vcl.uitest", "failed to execute dialog command: " << rCommand);
+}
+
 std::unique_ptr<UIObject> UITest::getFocusTopWindow()
 {
     ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/uitest/uno/uitest_uno.cxx b/vcl/source/uitest/uno/uitest_uno.cxx
index aad296e..c5a15a4 100644
--- a/vcl/source/uitest/uno/uitest_uno.cxx
+++ b/vcl/source/uitest/uno/uitest_uno.cxx
@@ -40,6 +40,8 @@ public:
 
     void SAL_CALL executeCommand(const OUString& rCommand) override;
 
+    void SAL_CALL executeDialog(const OUString& rCommand) override;
+
     css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getTopFocusWindow() override;
 
     OUString SAL_CALL getImplementationName() override;
@@ -61,6 +63,12 @@ void SAL_CALL UITestUnoObj::executeCommand(const OUString& rCommand)
     UITest::executeCommand(rCommand);
 }
 
+void SAL_CALL UITestUnoObj::executeDialog(const OUString& rCommand)
+{
+    SolarMutexGuard aGuard;
+    UITest::executeDialog(rCommand);
+}
+
 css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UITestUnoObj::getTopFocusWindow()
 {
     SolarMutexGuard aGuard;
commit 2a285790535c0ae4c2d791c8f8c44038203d82b7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Feb 27 04:02:48 2017 +0100

    uitest: remove old debug sleep statements
    
    Change-Id: I3ee755325cbf506b785b962c06c777ca45c025d3
    Reviewed-on: https://gerrit.libreoffice.org/34668
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/uitest/impress_tests/drawinglayer.py b/uitest/impress_tests/drawinglayer.py
index 0c7a254..d6a8920 100644
--- a/uitest/impress_tests/drawinglayer.py
+++ b/uitest/impress_tests/drawinglayer.py
@@ -30,8 +30,6 @@ class ImpressDrawinglayerTest(UITestCase):
         print(get_state_as_dict(xDrawinglayerObject))
         xDrawinglayerObject.executeAction("MOVE", mkPropertyValues({"X": "1000", "Y":"1000"}))
 
-        time.sleep(10)
-
         self.ui_test.close_doc()
 
     def test_resize_object(self):
@@ -49,8 +47,6 @@ class ImpressDrawinglayerTest(UITestCase):
         print(get_state_as_dict(xDrawinglayerObject))
         xDrawinglayerObject.executeAction("RESIZE", mkPropertyValues({"X": "500", "Y":"4000", "FRAC_X": "0.5", "FRAC_Y": "0.5"}))
 
-        time.sleep(5)
-
         self.ui_test.close_doc()
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list