From 10ff6760ef828de5d1dcaec5f490c107fd8c9468 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 6 Nov 2020 17:42:08 +0100 Subject: Stabilize tst_QQuickDropArea::containsDrag_internal It seems timing-sensitive; as usual when we have processEvents() and then QCOMPARE, it's often better to just use QTRY_COMPARE in case it runs slower than expected on CI VMs. Fixes: QTBUG-88206 Change-Id: Ie6916a00e16e025c32940e6bffcabd1159480c5a Reviewed-by: Liang Qi --- tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index dcba4c872e..593f3a0efb 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -134,17 +134,14 @@ void tst_QQuickDropArea::containsDrag_internal() QCOMPARE(evaluate(dropArea, "exitEvents"), 0); dragItem->setPosition(QPointF(50, 50)); - QCoreApplication::processEvents(); - QCOMPARE(evaluate(dropArea, "containsDrag"), true); + QTRY_COMPARE(evaluate(dropArea, "containsDrag"), true); QCOMPARE(evaluate(dropArea, "hasDrag"), true); QCOMPARE(evaluate(dropArea, "enterEvents"), 1); QCOMPARE(evaluate(dropArea, "exitEvents"), 0); evaluate(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); dragItem->setPosition(QPointF(150, 50)); - QCoreApplication::processEvents(); - - QCOMPARE(evaluate(dropArea, "containsDrag"), false); + QTRY_COMPARE(evaluate(dropArea, "containsDrag"), false); QCOMPARE(evaluate(dropArea, "hasDrag"), false); QCOMPARE(evaluate(dropArea, "enterEvents"), 0); QCOMPARE(evaluate(dropArea, "exitEvents"), 1); -- cgit v1.2.3