aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-01-14 21:58:48 +0100
committerLiang Qi <liang.qi@qt.io>2017-01-14 21:58:48 +0100
commit537eced61381f0ce1eabdc797bb0dacd11e11d39 (patch)
tree13ccb774329ca0214e89675e5f1d1ffa638f8ef6 /tests
parent698cffce2171bed322aa9d0df1fda316c379efda (diff)
parent6f7852a307c7ebbdb3b6efa00cbf7626b072bbc1 (diff)
Merge remote-tracking branch 'origin/5.8.0' into 5.8
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_dialogbuttonbox.qml4
-rw-r--r--tests/auto/controls/data/tst_switch.qml17
-rw-r--r--tests/auto/controls/data/tst_switchdelegate.qml17
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_dialogbuttonbox.qml b/tests/auto/controls/data/tst_dialogbuttonbox.qml
index 880d44c7..74a17c6d 100644
--- a/tests/auto/controls/data/tst_dialogbuttonbox.qml
+++ b/tests/auto/controls/data/tst_dialogbuttonbox.qml
@@ -104,9 +104,13 @@ TestCase {
verify(cancelButton)
compare(okButton.text.toUpperCase(), "OK")
compare(cancelButton.text.toUpperCase(), "CANCEL")
+ compare(control.standardButton(DialogButtonBox.Ok), okButton)
+ compare(control.standardButton(DialogButtonBox.Cancel), cancelButton)
control.standardButtons = 0
compare(control.count, 0)
+ compare(control.standardButton(DialogButtonBox.Ok), null)
+ compare(control.standardButton(DialogButtonBox.Cancel), null)
control.destroy()
}
diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml
index 314848c8..4a229ff0 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)
diff --git a/tests/auto/controls/data/tst_switchdelegate.qml b/tests/auto/controls/data/tst_switchdelegate.qml
index 23117ce7..ff8dbbc9 100644
--- a/tests/auto/controls/data/tst_switchdelegate.qml
+++ b/tests/auto/controls/data/tst_switchdelegate.qml
@@ -183,6 +183,23 @@ TestCase {
compare(control.pressed, false)
verify(spy.success)
+ // release in the middle
+ spy.expectedSequence = [["pressedChanged", { "pressed": true, "checked": false }],
+ "pressed"]
+ mousePress(control.indicator, 0, 0, Qt.LeftButton)
+ compare(control.pressed, true)
+ verify(spy.success)
+ mouseMove(control.indicator, control.indicator.width / 2 - 1, 0)
+ compare(control.pressed, true)
+ spy.expectedSequence = [["pressedChanged", { "pressed": false, "checked": false }],
+ "released",
+ "clicked"]
+ mouseRelease(control.indicator, control.indicator.width / 2 - 1, 0, 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)