aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_swipedelegate.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-22 18:38:32 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-24 14:41:55 +0000
commit9977778a401d98f3f0ee10fdd92ae5342c45ddbf (patch)
tree471fb017d591ca00ab9f1c5d7e4bba5ff0a45b63 /tests/auto/controls/data/tst_swipedelegate.qml
parent2349b299a9d18d1884067a6ee0fad55d1e2f8d38 (diff)
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 <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_swipedelegate.qml')
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml8
1 files changed, 4 insertions, 4 deletions
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);