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@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
parent
013e5bacc6
commit
3c979a362b
@ -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: */
|
||||
|
@ -21,6 +21,8 @@ interface XUITest
|
||||
void executeDialog([in] string command);
|
||||
|
||||
XUIObject getTopFocusWindow();
|
||||
|
||||
XUIObject getFloatWindow();
|
||||
};
|
||||
|
||||
}; }; }; }; };
|
||||
|
@ -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: */
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user