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

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Mar 26 02:56:57 UTC 2017


 include/vcl/uitest/uitest.hxx           |    2 ++
 offapi/com/sun/star/ui/test/XUITest.idl |    2 ++
 vcl/source/uitest/uitest.cxx            |   12 ++++++++++++
 vcl/source/uitest/uno/uitest_uno.cxx    |    9 +++++++++
 4 files changed, 25 insertions(+)

New commits:
commit 3c979a362b59b87dee62c85403c3c1f28f59f951
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 26 00:24:10 2017 +0100

    uitest: provide a way to select a floating window, e.g. popup menu
    
    Change-Id: Ice418b974c59c7d8c773b81a82f0a06c84547f10
    Reviewed-on: https://gerrit.libreoffice.org/35699
    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 53a049069a14..1674ad2fd50f 100644
--- a/include/vcl/uitest/uitest.hxx
+++ b/include/vcl/uitest/uitest.hxx
@@ -24,6 +24,8 @@ public:
     static void executeDialog(const OUString& rCommand);
 
     static std::unique_ptr<UIObject> getFocusTopWindow();
+
+    static std::unique_ptr<UIObject> getFloatWindow();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/ui/test/XUITest.idl b/offapi/com/sun/star/ui/test/XUITest.idl
index 89da44c7d6e7..55f234164296 100644
--- a/offapi/com/sun/star/ui/test/XUITest.idl
+++ b/offapi/com/sun/star/ui/test/XUITest.idl
@@ -21,6 +21,8 @@ interface XUITest
     void executeDialog([in] string command);
 
     XUIObject getTopFocusWindow();
+
+    XUIObject getFloatWindow();
 };
 
 }; }; }; }; };
diff --git a/vcl/source/uitest/uitest.cxx b/vcl/source/uitest/uitest.cxx
index 413201843ced..3b19a9acc49c 100644
--- a/vcl/source/uitest/uitest.cxx
+++ b/vcl/source/uitest/uitest.cxx
@@ -49,4 +49,16 @@ std::unique_ptr<UIObject> UITest::getFocusTopWindow()
     return rWinData.mpFirstFrame->GetUITestFactory()(rWinData.mpFirstFrame);
 }
 
+std::unique_ptr<UIObject> UITest::getFloatWindow()
+{
+    ImplSVData* pSVData = ImplGetSVData();
+    ImplSVWinData& rWinData = pSVData->maWinData;
+
+    VclPtr<vcl::Window> pFloatWin = rWinData.mpFirstFloat;
+    if (pFloatWin)
+        return pFloatWin->GetUITestFactory()(pFloatWin);
+
+    return nullptr;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uno/uitest_uno.cxx b/vcl/source/uitest/uno/uitest_uno.cxx
index c5a15a4f52ee..1d874c32c7d1 100644
--- a/vcl/source/uitest/uno/uitest_uno.cxx
+++ b/vcl/source/uitest/uno/uitest_uno.cxx
@@ -44,6 +44,8 @@ public:
 
     css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getTopFocusWindow() override;
 
+    css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getFloatWindow() override;
+
     OUString SAL_CALL getImplementationName() override;
 
     sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
@@ -76,6 +78,13 @@ css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UITestUnoObj::getTopFocus
     return new UIObjectUnoObj(std::move(pObj));
 }
 
+css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UITestUnoObj::getFloatWindow()
+{
+    SolarMutexGuard aGuard;
+    std::unique_ptr<UIObject> pObj = UITest::getFloatWindow();
+    return new UIObjectUnoObj(std::move(pObj));
+}
+
 OUString SAL_CALL UITestUnoObj::getImplementationName()
 {
     return OUString("org.libreoffice.uitest.UITest");


More information about the Libreoffice-commits mailing list