summaryrefslogtreecommitdiffstats
path: root/tests
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-28 06:03:19 +0000
commit4665d39414eb28e420d62f3c493f90ed4ee99a1e (patch)
tree2931abc7ef810eae41a3bb3aa0031a562296822c /tests
parentfb02d73ecbb57aa7eac37de6072d537bd36774cd (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>
Diffstat (limited to 'tests')
-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 04c6acfea1..dadb9f836c 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -2683,7 +2683,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, [&]()