aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-12-20 20:07:34 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2016-12-20 20:07:34 +0100
commit6e46d74b4d04fbf21ec7e57418ab5568f786b0e7 (patch)
tree8735964204723ad84af7a19b1d2eaca31c7d8f78 /tests/auto
parent66cca16867594f27b6d9e44101f1bd34d165c8ac (diff)
parent8148e5338de3c8d307f758c9ffcf1f7309fd48bd (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/imports/controls/material/DialogButtonBox.qml src/imports/controls/universal/DialogButtonBox.qml Change-Id: I16cbf9912a3526783c21a6f30996f83fce9e02c3
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_combobox.qml6
-rw-r--r--tests/auto/controls/data/tst_stackview.qml34
2 files changed, 33 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 68fe4c76..1a9040fa 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -1036,15 +1036,13 @@ TestCase {
var listview = control.popup.contentItem
verify(listview)
- waitForRendering(listview)
- compare(listview.contentItem.children.length, resetmodel.count + 1) // + highlight item
+ tryCompare(listview.contentItem.children, "length", resetmodel.count + 1) // + highlight item
resetmodel.clear()
resetmodel.append({text: "Fourth"})
resetmodel.append({text: "Fifth"})
- waitForRendering(listview)
- compare(listview.contentItem.children.length, resetmodel.count + 1) // + highlight item
+ tryCompare(listview.contentItem.children, "length", resetmodel.count + 1) // + highlight item
control.destroy()
}
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index b0e18389..44089e57 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -223,9 +223,9 @@ TestCase {
compare(control.depth, 0)
control.push(item, StackView.Immediate)
compare(control.depth, 1)
- control.push(item, StackView.Immediate)
- compare(control.depth, 2)
- control.pop(StackView.Immediate)
+ control.clear()
+ compare(control.depth, 0)
+ control.push(component, StackView.Immediate)
compare(control.depth, 1)
control.push(component, StackView.Immediate)
compare(control.depth, 2)
@@ -1020,4 +1020,32 @@ TestCase {
control.destroy()
}
+
+ function test_pushSameItem() {
+ var control = stackView.createObject(testCase)
+ verify(control)
+
+ control.push(item, StackView.Immediate)
+ compare(control.currentItem, item)
+ compare(control.depth, 1)
+
+ // Pushing the same Item should do nothing.
+ ignoreWarning(Qt.resolvedUrl("tst_stackview.qml") + ":59:9: QML StackView: push: nothing to push")
+ control.push(item, StackView.Immediate)
+ compare(control.currentItem, item)
+ compare(control.depth, 1)
+
+ // Push a component so that it becomes current.
+ var current = control.push(component, StackView.Immediate)
+ compare(control.currentItem, current)
+ compare(control.depth, 2)
+
+ // Push a bunch of stuff. "item" is already in the stack, so it should be ignored.
+ current = control.push(component, item, StackView.Immediate)
+ verify(current !== item)
+ compare(control.currentItem, current)
+ compare(control.depth, 3)
+
+ control.destroy()
+ }
}