on xenial help sign in
wait is evil
commit5e94102184245f15bf7746f784c66038c4fd7342 authorAlbert Astals <albert.astals@canonical.com> dateFri 11 Apr 2014, 10:32 (13 years ago) parentf62d7f4
1 file changed+4−2
tests/qmltests/Components/tst_Carousel.qml+4−2
tests/qmltests/Components/tst_Carousel.qml+4−2
@@ -227,12 +227,14 @@ Item {
227227 var stepAnimation = findInvisibleChild(carouselList, "stepAnimation");
228228 var stepDiff = 0;
229229 stepAnimation.onRunningChanged.connect(function() { if (stepAnimation.running) stepDiff = Math.abs(carouselList.contentX - stepAnimation.to); })
230− while (carouselList.realContentX < carouselList.realContentWidth - carouselList.realWidth) {
230+ var overshootOnce = false;
231+ while (!overshootOnce) {
232+ overshootOnce = carouselList.realContentX > carouselList.realContentWidth - carouselList.realWidth;
231233 mouseFlick(carousel, carousel.width - units.gu(1),
232234 carousel.height / 2,
233235 units.gu(2),
234236 carousel.height / 2);
235− wait(1000);
237+ tryCompare(carouselList, "moving", false);
236238 }
237239 verify(stepDiff < 1);
238240 var x = carouselList.getXFromContinuousIndex(carousel.model - 1);