diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-27 09:52:39 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-01-27 14:00:57 +0000 |
commit | 58496196071ec817d141c14fe373939ae0df6383 (patch) | |
tree | 9c0f381684575e050f51d3a4c2fabefb50a905e4 /tests | |
parent | 3c9013b76a6f4214f469613baf7ae5225b649660 (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
Pick-to: 5.15
Pick-to: 6.0
Change-Id: Ie1bc4157e6d0e807d8530f70dcbd27b5e2fc813c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 4 |
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, [&]() |