From cd7481371ba5f9b328e9619fba98701dbe74530c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 7 Oct 2020 20:36:20 +0200 Subject: Speed up tst_qquickflickable Speed up animations that the test spends too much time waiting to complete. Change-Id: I7941660f3c3a89798c5cdd0eee8018a44fb89a0d Reviewed-by: Mitch Curtis --- .../auto/quick/qquickflickable/data/flickable03.qml | 3 +++ .../quick/qquickflickable/data/nestedPressDelay.qml | 20 ++++++++++++++++++++ .../qquickflickable/data/nestedStopAtBounds.qml | 19 +++++++++++++++++++ tests/auto/quick/qquickflickable/data/overshoot.qml | 9 +++++++++ .../quick/qquickflickable/tst_qquickflickable.cpp | 3 --- 5 files changed, 51 insertions(+), 3 deletions(-) (limited to 'tests/auto/quick') diff --git a/tests/auto/quick/qquickflickable/data/flickable03.qml b/tests/auto/quick/qquickflickable/data/flickable03.qml index 1549034576..5825bbe637 100644 --- a/tests/auto/quick/qquickflickable/data/flickable03.qml +++ b/tests/auto/quick/qquickflickable/data/flickable03.qml @@ -18,6 +18,9 @@ Flickable { draggingInContentY = draggingInContentY && draggingVertically } + // speed up test runs + flickDeceleration: 5000 + Column { id: column Repeater { diff --git a/tests/auto/quick/qquickflickable/data/nestedPressDelay.qml b/tests/auto/quick/qquickflickable/data/nestedPressDelay.qml index 3cc0987141..2d1201d58b 100644 --- a/tests/auto/quick/qquickflickable/data/nestedPressDelay.qml +++ b/tests/auto/quick/qquickflickable/data/nestedPressDelay.qml @@ -9,6 +9,16 @@ Flickable { contentHeight: 320 flickableDirection: Flickable.HorizontalFlick pressDelay: 10000 + + // faster rebound to speed up test runs + rebound: Transition { + NumberAnimation { + properties: "x,y" + duration: 30 + easing.type: Easing.OutBounce + } + } + MouseArea { objectName: "filteringMouseArea" x: 20 @@ -28,6 +38,16 @@ Flickable { contentWidth: 1480 contentHeight: 400 pressDelay: 50 + + // faster rebound to speed up test runs + rebound: Transition { + NumberAnimation { + properties: "x,y" + duration: 30 + easing.type: Easing.OutBounce + } + } + Rectangle { y: 100 x: 80 diff --git a/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml b/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml index 902920babc..f2d25b292f 100644 --- a/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml +++ b/tests/auto/quick/qquickflickable/data/nestedStopAtBounds.qml @@ -11,6 +11,15 @@ Flickable { contentHeight: 500 flickableDirection: inner.flickableDirection + // faster rebound to speed up test runs + rebound: Transition { + NumberAnimation { + properties: "x,y" + duration: 30 + easing.type: Easing.OutBounce + } + } + Rectangle { x: 100 y: 100 @@ -29,6 +38,16 @@ Flickable { contentWidth: 400 contentHeight: 400 boundsBehavior: Flickable.StopAtBounds + + // faster rebound to speed up test runs + rebound: Transition { + NumberAnimation { + properties: "x,y" + duration: 30 + easing.type: Easing.OutBounce + } + } + Rectangle { anchors.fill: parent anchors.margins: 100 diff --git a/tests/auto/quick/qquickflickable/data/overshoot.qml b/tests/auto/quick/qquickflickable/data/overshoot.qml index 4235156479..f08460a413 100644 --- a/tests/auto/quick/qquickflickable/data/overshoot.qml +++ b/tests/auto/quick/qquickflickable/data/overshoot.qml @@ -32,6 +32,15 @@ Flickable { width: 200; height: 200 contentWidth: rect.width; contentHeight: rect.height + // faster rebound to speed up test runs + rebound: Transition { + NumberAnimation { + properties: "x,y" + duration: 30 + easing.type: Easing.OutBounce + } + } + property real minContentY: 0 property real maxContentY: 0 onContentYChanged: { diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 94f2451c97..9aed54b487 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -1798,7 +1798,6 @@ void tst_qquickflickable::nestedStopAtBounds() // drag away from the aligned boundary. Inner flickable dragged. moveAndPress(&view, position); - QTest::qWait(10); axis += invert ? -threshold * 2 : threshold * 2; QTest::mouseMove(&view, position); axis += invert ? -threshold : threshold; @@ -1822,7 +1821,6 @@ void tst_qquickflickable::nestedStopAtBounds() // Drag inner with equal size and contentSize moveAndPress(&view, position); - QTest::qWait(10); axis += invert ? -threshold * 2 : threshold * 2; QTest::mouseMove(&view, position); axis += invert ? -threshold : threshold; @@ -1846,7 +1844,6 @@ void tst_qquickflickable::nestedStopAtBounds() // Drag inner with size greater than contentSize moveAndPress(&view, position); - QTest::qWait(10); axis += invert ? -threshold * 2 : threshold * 2; QTest::mouseMove(&view, position); axis += invert ? -threshold : threshold; -- cgit v1.2.3