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@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
parent
2a28579053
commit
aa10a19c8e
@ -21,6 +21,8 @@ public:
|
||||
|
||||
static void executeCommand(const OUString& rCommand);
|
||||
|
||||
static void executeDialog(const OUString& rCommand);
|
||||
|
||||
static std::unique_ptr<UIObject> getFocusTopWindow();
|
||||
};
|
||||
|
||||
|
@ -18,6 +18,8 @@ interface XUITest
|
||||
{
|
||||
void executeCommand([in] string command);
|
||||
|
||||
void executeDialog([in] string command);
|
||||
|
||||
XUIObject getTopFocusWindow();
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user