summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Weghorn <[email protected]>2024-08-26 17:59:49 +0200
committerMichael Weghorn <[email protected]>2024-08-28 14:48:57 +0200
commit94929a63c8e26b924c4db78b88344fcc21530595 (patch)
treea48cc94497cbb12d5f4acd9d727a56c1acc2a1c0
parentde91f5da67adce38cd0dbf5bb804365c11125111 (diff)
a11y tests: Make combobox focus tests more reliable
The combobox focus test was occasionally (in 2 out of 20 runs) failing in my setup with with QT_QPA_PLATFORM=xcb as follows: 1: FAIL! : tst_QAccessibility::focusChild() 'QTestAccessibility::containsEvent(&focusEvent)' returned FALSE. () 1: Loc: [.../qt5/qtbase/tests/auto/other/qaccessibility/tst_qaccessibility.cpp(4606)] Wait for the combobox to actually have focus before checking for the a11y event. Change-Id: I913173bb504d2fdd6ac1dab6f70c49c849550eff Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 5b8f6d641e6..11110e352ef 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -4601,6 +4601,7 @@ void tst_QAccessibility::focusChild()
QAccessibleInterface *iface = nullptr;
comboBox.setFocus();
+ QTRY_VERIFY(comboBox.hasFocus());
{
QAccessibleEvent focusEvent(&comboBox, QAccessible::Focus);
QVERIFY(QTestAccessibility::containsEvent(&focusEvent));
@@ -4610,6 +4611,7 @@ void tst_QAccessibility::focusChild()
QCOMPARE(iface->focusChild(), nullptr);
editableComboBox.setFocus();
+ QTRY_VERIFY(editableComboBox.hasFocus());
// Qt updates about the editable combobox, not the lineedit, as the
// combobox is the lineedit's focus proxy.
{