aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_swipedelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_swipedelegate.qml')
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml
index 17440042ca..7b4fdcd127 100644
--- a/tests/auto/controls/data/tst_swipedelegate.qml
+++ b/tests/auto/controls/data/tst_swipedelegate.qml
@@ -963,25 +963,26 @@ TestCase {
// Swipe from right to left without exposing the right item,
// and make sure that the right item never becomes visible
// (and hence that the left item never loses visibility).
- mousePress(control, control.swipe.leftItem.width, control.height / 2, Qt.LeftButton);
+ mousePress(control, control.swipe.leftItem.width - 1, control.height / 2, Qt.LeftButton);
compare(leftVisibleSpy.count, 0);
compare(rightVisibleSpy.count, 0);
- var newX = control.swipe.leftItem.width - Math.round(dragDistance * 1.1);
+ var newX = control.swipe.leftItem.width - Math.round(dragDistance * 1.1) -1;
mouseMove(control, newX, control.height / 2);
compare(leftVisibleSpy.count, 0);
compare(rightVisibleSpy.count, 0);
- compare(control.swipe.position, newX / control.swipe.leftItem.width);
+ compare(control.swipe.position, (newX + 1) / control.swipe.leftItem.width);
mouseMove(control, 0, control.height / 2);
- compare(control.swipe.position, 0);
+ compare(control.swipe.position, 1 / control.swipe.leftItem.width);
+ // Because we move from (width - 1) to 0, so one pixel remains
// Test swiping over a distance that is greater than the width of the left item.
mouseMove(control, -1, control.height / 2);
verify(control.swipe.rightItem);
- compare(control.swipe.position, -1 / control.swipe.rightItem.width);
+ compare(control.swipe.position, 0);
// Now go back to 1.0.
- mouseMove(control, control.swipe.leftItem.width, control.height / 2);
+ mouseMove(control, control.swipe.leftItem.width - 1, control.height / 2);
compare(control.swipe.position, 1.0);
tryCompare(control.background, "x", control.swipe.leftItem.width, 1000);
mouseRelease(control, control.swipe.leftItem.width, control.height / 2, Qt.LeftButton);