summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-01-27 09:52:39 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-27 20:48:56 +0000
commit0d92fe119da3144f6334faa83563e52728a16dda (patch)
tree8624d743cf7fe1c58dd23f5de357f26da2257fc5
parentd85ad71ed9c0a13a226756f9807a409a60a04df2 (diff)
Stabilize tst_QListView::internalDragDropMove() on X11
The test was flaky in recent test runs on X11. Debugging showed that the global position of the synthesized mouse events was not correct due to the window not being mapped properly. Use QTest::qWaitForWindowActive() instead of QTest::qWaitForWindowExposed() to ensure that. Task-number: QTBUG-90016 Change-Id: Ie1bc4157e6d0e807d8530f70dcbd27b5e2fc813c Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 58496196071ec817d141c14fe373939ae0df6383) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 0f3671708d..98dec7ded9 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -2675,7 +2675,9 @@ void tst_QListView::internalDragDropMove()
selectedTexts << data.itemData(index).value(Qt::DisplayRole).toString();
return selectedTexts;
};
- QVERIFY(QTest::qWaitForWindowExposed(&list));
+ // The test relies on the global position of mouse events; make sure
+ // the window is properly mapped on X11.
+ QVERIFY(QTest::qWaitForWindowActive(&list));
// execute as soon as the eventloop is running again
// which is the case inside list.startDrag()
QTimer::singleShot(0, [&]()