From 655f6164e38c2f675beb5272fc6a9780f4767429 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 31 Jan 2023 11:25:28 +0100 Subject: test: Run user dialog callback in idle time On e.g. Windows we need to let the dialogs fully finish starting up before we can properly interact with them, and especially close them again. We notice new dialogs with the WindowActivate event, but this will happen before the dialog is fully set up internally, leading to failures on Windows. In practice, the WindowActivate event might be dispatched before the dialog setup function finishes, leading to an intermediate state at WindowActivate time. Work around this by running the user code in an idle timer in response to the WindowActivate event, so that the setup code can return before the callback is dispatched. Based on findings by Michael Weghorn, thanks! Change-Id: Ieecee09d84144570fe1943ca12dc1db6d9f64524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146378 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- test/qa/cppunit/dialog.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/qa/cppunit') diff --git a/test/qa/cppunit/dialog.cxx b/test/qa/cppunit/dialog.cxx index c3f68a8f0e4e..0e188d52aa85 100644 --- a/test/qa/cppunit/dialog.cxx +++ b/test/qa/cppunit/dialog.cxx @@ -9,8 +9,8 @@ #include -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(MACOSX) && !defined(_WIN32) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) /* Checks an unexpected dialog opening (instead of the expected one) is properly caught, as it would * otherwise block the test potentially indefinitely */ CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, SelfTestIncorrectDialog) @@ -29,8 +29,8 @@ CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, SelfTestIncorrectDialog) } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(MACOSX) && !defined(_WIN32) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) /* Checks that an exception in the dialog callback code is properly handled and won't disturb * subsequent tests if caught -- especially that DialogWaiter::waitEndDialog() won't timeout. */ CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, SelfTestThrowInDialogCallback) -- cgit