aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmltest/animatedimage/tst_animatedimage.qml')
-rw-r--r--tests/auto/qmltest/animatedimage/tst_animatedimage.qml43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
index 6ddd0e3024..c7e0aa2711 100644
--- a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
+++ b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
@@ -114,6 +114,44 @@ Item {
fillMode: AnimatedImage.TileHorizontally
}
+ Loader {
+ id: raceConditionLoader
+ active: false
+ anchors.fill: parent
+
+ sourceComponent: ListView {
+ anchors.fill: parent
+ model: 5000
+ delegate: Item {
+ height: 10
+ width: parent.width
+ Text {
+ anchors.fill: parent
+ text: index
+ }
+ AnimatedImage {
+ anchors.fill: parent
+ source: "http://127.0.0.1/some-image-url.gif"
+ Component.onCompleted: source = "";
+ }
+ }
+
+ function scrollToNext() {
+ currentIndex = currentIndex + 30 < model ? currentIndex + 30 : model;
+ positionViewAtIndex(currentIndex, ListView.Beginning);
+ if (currentIndex >= model)
+ raceConditionLoader.active = false;
+ }
+
+ property Timer timer: Timer {
+ interval: 10
+ repeat: true
+ onTriggered: parent.scrollToNext()
+ Component.onCompleted: start()
+ }
+ }
+ }
+
TestCase {
name: "AnimatedImage"
@@ -216,5 +254,10 @@ Item {
compare(tileModes3.fillMode, AnimatedImage.TileHorizontally)
}
+ function test_crashRaceCondition_replyFinished() {
+ raceConditionLoader.active = true;
+ tryCompare(raceConditionLoader, "active", false);
+ }
+
}
}