aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-22 03:05:56 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-22 03:05:57 +0100
commit35afc8d21b2f705463ec56d3e11679efb798b757 (patch)
tree1ed9824247f3a689ed24d91da54c01ec99c662bb /tests/auto
parentc9260cd940fe9ca0e440b715cbfc13dd046e07b0 (diff)
parent09476c590ab13623130d5ac79045fa68e504be96 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15v5.15.0-beta1
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_abstractbutton.qml23
-rw-r--r--tests/auto/controls/data/tst_button.qml3
-rw-r--r--tests/auto/controls/data/tst_delaybutton.qml3
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml3
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml26
5 files changed, 51 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml
index ee26a6d6..da5642cc 100644
--- a/tests/auto/controls/data/tst_abstractbutton.qml
+++ b/tests/auto/controls/data/tst_abstractbutton.qml
@@ -887,4 +887,27 @@ TestCase {
mouseRelease(control)
compare(clickedSpy.count, 1)
}
+
+ function test_doubleClick() {
+ let control = createTemporaryObject(button, testCase, { text: "Hello" })
+ verify(control)
+
+ let pressedSpy = signalSpy.createObject(control, { target: control, signalName: "pressed" })
+ verify(pressedSpy.valid)
+
+ let releasedSpy = signalSpy.createObject(control, { target: control, signalName: "released" })
+ verify(releasedSpy.valid)
+
+ let clickedSpy = signalSpy.createObject(control, { target: control, signalName: "clicked" })
+ verify(clickedSpy.valid)
+
+ let doubleClickedSpy = signalSpy.createObject(control, { target: control, signalName: "doubleClicked" })
+ verify(doubleClickedSpy.valid)
+
+ mouseDoubleClickSequence(control)
+ compare(pressedSpy.count, 2)
+ compare(releasedSpy.count, 2)
+ compare(clickedSpy.count, 1)
+ compare(doubleClickedSpy.count, 1)
+ }
}
diff --git a/tests/auto/controls/data/tst_button.qml b/tests/auto/controls/data/tst_button.qml
index bd4fe80e..83a6ea61 100644
--- a/tests/auto/controls/data/tst_button.qml
+++ b/tests/auto/controls/data/tst_button.qml
@@ -152,8 +152,7 @@ TestCase {
"doubleClicked",
["pressedChanged", { "pressed": false }],
["downChanged", { "down": false }],
- "released",
- "clicked"]
+ "released"]
mouseDoubleClickSequence(control, control.width / 2, control.height / 2, Qt.LeftButton)
verify(sequenceSpy.success)
}
diff --git a/tests/auto/controls/data/tst_delaybutton.qml b/tests/auto/controls/data/tst_delaybutton.qml
index 2560177d..e965b5ef 100644
--- a/tests/auto/controls/data/tst_delaybutton.qml
+++ b/tests/auto/controls/data/tst_delaybutton.qml
@@ -173,8 +173,7 @@ TestCase {
"doubleClicked",
["pressedChanged", { "pressed": false }],
["downChanged", { "down": false }],
- "released",
- "clicked"]
+ "released"]
mouseDoubleClickSequence(control, control.width / 2, control.height / 2, Qt.LeftButton)
verify(sequenceSpy.success)
}
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml
index 3e2ff460..71eb0b99 100644
--- a/tests/auto/controls/data/tst_swipedelegate.qml
+++ b/tests/auto/controls/data/tst_swipedelegate.qml
@@ -654,8 +654,7 @@ TestCase {
"pressed",
"doubleClicked",
["pressedChanged", { "pressed": false }],
- "released",
- "clicked"
+ "released"
];
mouseDoubleClickSequence(control, control.width / 2, control.height / 2, Qt.LeftButton);
verify(mouseSignalSequenceSpy.success);
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index d98a7cc8..adea23ef 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -227,15 +227,39 @@ TestCase {
id: toolTipWithExitTransition
ToolTip {
+ Component.onCompleted: contentItem.objectName = "contentItem"
+
enter: Transition {
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 100 }
}
exit: Transition {
- NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 1000 }
+ NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 500 }
}
}
}
+ function test_openDuringExitTransitionWithTimeout() {
+ let control = createTemporaryObject(toolTipWithExitTransition, testCase, { timeout: 250 })
+ verify(control)
+ control.open()
+ verify(control.visible)
+ // Can't be fully open yet because the enter transition has only just started.
+ compare(control.opened, false)
+ compare(control.enter.running, true)
+ tryCompare(control, "opened", true)
+
+ // Let it timeout and begin the exit transition.
+ tryCompare(control, "opened", false)
+ verify(control.visible)
+ tryCompare(control.exit, "running", true)
+ verify(control.visible)
+
+ // Quickly open it again; it should still timeout eventually.
+ control.open()
+ tryCompare(control, "opened", true)
+ tryCompare(control.exit, "running", true)
+ }
+
function test_makeVisibleWhileExitTransitionRunning_data() {
return [
{ tag: "imperative", imperative: true },