From 9977778a401d98f3f0ee10fdd92ae5342c45ddbf Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 22 Oct 2016 18:38:32 +0200 Subject: Fix tst_swipedelegate These tests did not pass on my Chromebook Pixel 2. The value of Qt.styleHints.startDragDistance is 19. Change-Id: I8843803608fc4c8ca2f2c42790d648eb17c141fd Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_swipedelegate.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml index 16cfea14..21bb1a37 100644 --- a/tests/auto/controls/data/tst_swipedelegate.qml +++ b/tests/auto/controls/data/tst_swipedelegate.qml @@ -304,7 +304,7 @@ TestCase { var control = swipeDelegateComponent.createObject(testCase); verify(control); - var overDragDistance = dragDistance * 1.1; + var overDragDistance = Math.round(dragDistance * 1.1); mouseSignalSequenceSpy.target = control; mouseSignalSequenceSpy.expectedSequence = [["pressedChanged", { "pressed": true }], "pressed"]; @@ -433,7 +433,7 @@ TestCase { var control = swipeDelegateComponent.createObject(testCase); verify(control); - var distance = dragDistance * 1.1; + var distance = Math.round(dragDistance * 1.1); if (distance >= control.width / 2) skip("This test requires a startDragDistance that is less than half the width of the control"); @@ -826,7 +826,7 @@ TestCase { control.swipe.left = smallLeftComponent; // Ensure that the position is scaled to the width of the currently visible delegate. - var overDragDistance = dragDistance * 1.1; + var overDragDistance = Math.round(dragDistance * 1.1); mousePress(control, control.width / 2, control.height / 2, Qt.LeftButton); mouseMove(control, control.width / 2 + overDragDistance, control.height / 2, Qt.LeftButton); verify(control.swipe.leftItem); @@ -885,7 +885,7 @@ TestCase { mousePress(control, control.swipe.leftItem.width, control.height / 2, Qt.LeftButton); compare(leftVisibleSpy.count, 0); compare(rightVisibleSpy.count, 0); - var newX = control.swipe.leftItem.width - dragDistance * 1.1; + var newX = control.swipe.leftItem.width - Math.round(dragDistance * 1.1); mouseMove(control, newX, control.height / 2, Qt.LeftButton, Qt.LeftButton); compare(leftVisibleSpy.count, 0); compare(rightVisibleSpy.count, 0); -- cgit v1.2.3