aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_switch.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_switch.qml')
-rw-r--r--tests/auto/controls/data/tst_switch.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml
index f3843cf7..52d2d7fc 100644
--- a/tests/auto/controls/data/tst_switch.qml
+++ b/tests/auto/controls/data/tst_switch.qml
@@ -187,6 +187,23 @@ TestCase {
compare(control.pressed, false)
verify(spy.success)
+ // release in the middle
+ spy.expectedSequence = [["pressedChanged", { "pressed": true, "checked": false }],
+ "pressed"]
+ mousePress(control, 0, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ verify(spy.success)
+ mouseMove(control, control.width / 4, control.height / 4, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ spy.expectedSequence = [["pressedChanged", { "pressed": false, "checked": false }],
+ "released",
+ "clicked"]
+ mouseRelease(control, control.width / 4, control.height / 4, Qt.LeftButton)
+ compare(control.checked, false)
+ compare(control.pressed, false)
+ tryCompare(control, "position", 0) // QTBUG-57944
+ verify(spy.success)
+
// right button
spy.expectedSequence = []
mousePress(control, control.width / 2, control.height / 2, Qt.RightButton)