How to handle unexpected error dialogs in UITests?

Miklos Vajna vmiklos at collabora.com
Mon Mar 30 08:02:15 UTC 2020


Hi Stephan,

On Thu, Mar 26, 2020 at 11:07:51AM +0100, Stephan Bergmann <sbergman at redhat.com> wrote:
> The question is how UITests should avoid such deadlocks.  The behavior of
> ErrorHandler::HandleError (vcl/source/window/errinf.cxx) can be modified via
> ErrorRegistry::RegisterDisplay (vcl/source/window/errinf.cxx), to call a
> user-provided BasicDisplayErrorFunc instead of showing a VCL error dialog.
> But:
> 
> * There appears to be no UNO API to call ErrorRegistry::RegisterDisplay
> remotely from the UITest's Python code.
> 
> * There appears to be no way to only temporarily set
> ErrorRegistry::RegisterDisplay and then undo it again.  So it would be
> problematic for a UITest to do some tests (which explicitly want to test
> interaction with a VCL error dialog, say) without a set
> ErrorRegistry::RegisterDisplay, while doing all the its other tests with a
> set ErrorRegistry::RegisterDisplay (so as to avoid deadlocks caused by
> unexpected errors raising unexpected VCL error dialogs).

What if we add a new optional bool property to VCLXToolkit to fail early
without invoking the handler registered via
ErrorRegistry::RegisterDisplay()? The uitest setup code would enable
that by default, but a specific test could still disable it if wanted.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20200330/bfecb2d0/attachment.sig>


More information about the LibreOffice mailing list