summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
commit4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (patch)
treecc68622c9b85992d99a8373ab55471ee821a4ebf /tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
parentab28ff2207e8f33754c79793089dbf943d67736d (diff)
parentebb49c66aaf22ed55d62ff7bc3690fce00b7d8ba (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Diffstat (limited to 'tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm')
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm21
1 files changed, 9 insertions, 12 deletions
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index d97a0db939..174d86a941 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -86,6 +86,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
return false; \
} \
+#define TRY_EXPECT(cond) EXPECT(QTest::qWaitFor([&]{ return (cond); }))
@interface TestAXObject : NSObject
{
@@ -546,21 +547,17 @@ bool notifications(QWidget *w)
EXPECT(notificationList.length() == 0);
le2->setFocus();
- QCoreApplication::processEvents();
- EXPECT(notificationList.length() == 1);
- EXPECT(notificationList.at(0) == QAccessible::Focus);
+ TRY_EXPECT(notificationList.length() == 1);
+ TRY_EXPECT(notificationList.at(0) == QAccessible::Focus);
le1->setFocus();
- QCoreApplication::processEvents();
- EXPECT(notificationList.length() == 2);
- EXPECT(notificationList.at(1) == QAccessible::Focus);
+ TRY_EXPECT(notificationList.length() == 2);
+ TRY_EXPECT(notificationList.at(1) == QAccessible::Focus);
le1->setText("hello");
- QCoreApplication::processEvents();
- EXPECT(notificationList.length() == 3);
- EXPECT(notificationList.at(2) == QAccessible::ValueChanged);
+ TRY_EXPECT(notificationList.length() == 3);
+ TRY_EXPECT(notificationList.at(2) == QAccessible::ValueChanged);
le1->setText("foo");
- QCoreApplication::processEvents();
- EXPECT(notificationList.length() == 4);
- EXPECT(notificationList.at(3) == QAccessible::ValueChanged);
+ TRY_EXPECT(notificationList.length() == 4);
+ TRY_EXPECT(notificationList.at(3) == QAccessible::ValueChanged);
return true;
}