Decouple flickable stopAtBounds test from mouse event timing
authorUlf Hermann <ulf.hermann@theqtcompany.com>
Wed, 3 Jun 2015 13:01:23 +0000 (15:01 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Fri, 5 Jun 2015 05:51:28 +0000 (05:51 +0000)
We don't really want to know if the flickable is still flicking at the
end of the flick() call, but rather if it has been flicking at some
point.

Change-Id: Ib6c89023042b2a45e66f1825a699bb47dc6e13ee
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp

index da5463a..44da9a6 100644 (file)
@@ -1651,12 +1651,14 @@ void tst_qquickflickable::stopAtBounds()
     } else {
         flickable->setContentX(invert ? 100 : 0);
     }
+
+    QSignalSpy flickSignal(flickable, SIGNAL(flickingChanged()));
     if (invert)
         flick(&view, QPoint(20,20), QPoint(120,120), 100);
     else
         flick(&view, QPoint(120,120), QPoint(20,20), 100);
 
-    QVERIFY(flickable->isFlicking());
+    QVERIFY(flickSignal.count() > 0);
     if (transpose) {
         if (invert)
             QTRY_COMPARE(flickable->isAtYBeginning(), true);