[Libreoffice-commits] core.git: include/test sw/qa test/qa test/source
include/test/a11y/accessibletestbase.hxx |2 ++ sw/qa/extras/accessibility/dialogs.cxx | 24 test/qa/cppunit/dialog.cxx |9 - test/source/a11y/accessibletestbase.cxx |9 - 4 files changed, 18 insertions(+), 26 deletions(-) New commits: commit d1589ade91cfadf860c31ca30c97a60f95afa928 Author: Colomban Wendling AuthorDate: Thu Feb 23 16:34:49 2023 +0100 Commit: Michael Weghorn CommitDate: Fri Mar 3 10:58:22 2023 + Disable test::AccessibleTestBase::awaitDialog() on macos altogether The API doesn't actually work there yet because we don't get any event, so there's no point in exposing it there, and it makes it clear it isn't available there, avoiding future user to wonder why their tests do not behave there. Change-Id: I38dcc98ad3bc3b669df64bc1c53c91ef48a0d717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147574 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/include/test/a11y/accessibletestbase.hxx b/include/test/a11y/accessibletestbase.hxx index 1445d0eb4737..e23c2e12467e 100644 --- a/include/test/a11y/accessibletestbase.hxx +++ b/include/test/a11y/accessibletestbase.hxx @@ -181,6 +181,7 @@ protected: const css::uno::Reference& xChild, const EventPosterHelperBase* pEventPosterHelper = nullptr); +#if !defined(MACOSX) /* Dialog handling */ class Dialog : public test::AccessibleEventPosterHelper { @@ -286,6 +287,7 @@ protected: static std::shared_ptr awaitDialog(const std::u16string_view name, std::function callback, bool bAutoClose = true); +#endif //defined(MACOSX) public: virtual void setUp() override; diff --git a/sw/qa/extras/accessibility/dialogs.cxx b/sw/qa/extras/accessibility/dialogs.cxx index e6e3ac84c068..7997f7743b1e 100644 --- a/sw/qa/extras/accessibility/dialogs.cxx +++ b/sw/qa/extras/accessibility/dialogs.cxx @@ -17,8 +17,9 @@ using namespace css; -// FIXME: dialog doesn't pop up on macos... +// FIXME: dialog API doesn't work on macos yet #if !defined(MACOSX) + CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialog) { load(u"private:factory/swriter"); @@ -62,10 +63,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialo CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"©"), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) /* checks for the fix from https://gerrit.libreoffice.org/c/core/+/147660 */ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocus) { @@ -96,10 +94,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocu CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"0"), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) { load(u"private:factory/swriter"); @@ -123,10 +118,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) CPPUNIT_ASSERT_EQUAL(rtl::OUString("https://libreoffice.org/"), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) { load(u"private:factory/swriter"); @@ -150,10 +142,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) CPPUNIT_ASSERT_EQUAL(rtl::OUString("#Test Bookmark 1 Bookmark "), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) { load(u"private:factory/swriter"); @@ -171,10 +160,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) CPPUNIT_ASSERT_EQUAL(rtl::OUString(""), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) { load(u"private:factory/swriter"); @@ -195,10 +181,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) "description=\"Paragraph: 0 Simple\">Simple"), collectText()); } -#endif -// FIXME: dialog doesn't pop up on macos... -#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFrameDialog) { load(u"private:factory/swriter"); @@ -216,6 +199,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFrameDialog) rtl::OUString(""), collectText()); } -#endif + +#endif //defined(MACOSX) /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff
[Libreoffice-commits] core.git: include/test sw/qa test/qa test/source
include/test/a11y/accessibletestbase.hxx |5 --- sw/qa/extras/accessibility/dialogs.cxx | 28 ++-- test/qa/cppunit/dialog.cxx |8 ++--- test/source/a11y/accessibletestbase.cxx | 43 +++ 4 files changed, 51 insertions(+), 33 deletions(-) New commits: commit 655f6164e38c2f675beb5272fc6a9780f4767429 Author: Colomban Wendling AuthorDate: Tue Jan 31 11:25:28 2023 +0100 Commit: Michael Weghorn CommitDate: Fri Mar 3 10:57:11 2023 + 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 diff --git a/include/test/a11y/accessibletestbase.hxx b/include/test/a11y/accessibletestbase.hxx index 0048edcd8589..5f5fb54aff4b 100644 --- a/include/test/a11y/accessibletestbase.hxx +++ b/include/test/a11y/accessibletestbase.hxx @@ -183,14 +183,11 @@ protected: /* Dialog handling */ class Dialog : public test::EventPosterHelper { -friend class AccessibleTestBase; - private: bool mbAutoClose; -Dialog(vcl::Window* pWindow, bool bAutoClose = true); - public: +Dialog(vcl::Window* pWindow, bool bAutoClose = true); virtual ~Dialog(); void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; } diff --git a/sw/qa/extras/accessibility/dialogs.cxx b/sw/qa/extras/accessibility/dialogs.cxx index 13c2fd0cb750..e6e3ac84c068 100644 --- a/sw/qa/extras/accessibility/dialogs.cxx +++ b/sw/qa/extras/accessibility/dialogs.cxx @@ -17,8 +17,8 @@ using namespace css; -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialog) { load(u"private:factory/swriter"); @@ -64,8 +64,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSpecialCharactersDialo } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) /* checks for the fix from https://gerrit.libreoffice.org/c/core/+/147660 */ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocus) { @@ -98,8 +98,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, TestSpecialCharactersDialogFocu } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) { load(u"private:factory/swriter"); @@ -125,8 +125,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog) } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) { load(u"private:factory/swriter"); @@ -152,8 +152,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog) } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) { load(u"private:factory/swriter"); @@ -173,8 +173,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog) } #endif -// FIXME: dialog doesn't pop up on macos and doesn't close on win32... -#if !defined(_WIN32) && !defined(MACOSX) +// FIXME: dialog doesn't pop up on macos... +#if !defined(MACOSX) CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) { load(u"private:factory/swriter"); @@ -197,8 +197,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog) } #endif -// FIXME: dialog doesn't pop up on macos and doesn't