Unittest: How to exit slideshow mode?
Regina Henschel
rb.henschel at t-online.de
Mon Jul 28 17:05:43 UTC 2025
Hi Miklos,
Miklos Vajna schrieb am 28.07.2025 um 09:40:
> Hi Regina,
>
> On Sun, Jul 27, 2025 at 11:22:50PM +0200, Regina Henschel <rb.henschel at t-online.de> wrote:
>> So how to start and end a slideshow in a unit test? Or is it impossible?
>
> In general, you could see what's the backtrace of a starting
> presentation in the interactive desktop case and then see if you can
> trigger the same codepath from cppunit, see here:
>
> https://wiki.documentfoundation.org/Development/Cpp_Unit_Tests#Discovering_a_test_strategy
>
> I don't know if the desktop slideshow's additional window is similar to
> other dialogs which are auto-cancelled when cppunit tests are running.
It seems so. But I have now changed the settings in the test document
so, that the slideshow does not run in full screen mode but in window
mode. With that change,
xPresentation->start();
really starts the slideshow.
> If so, then yes, this would be tricky to test from cppunit.
It is tricky. xPresentation->end(); will correctly finish the slideshow.
But using that way does not trigger the registerUserPaintPolygons()
method that was reason for the bug.
But I can use the method typeKey() that is already defined in
uiimpress.cxx to simulate a key press. And that works then.
Kind regards,
Regina
More information about the LibreOffice
mailing list