summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@jollamobile.com>2013-12-16 16:42:32 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-16 00:27:42 +0100
commit0a32e757285ecc643ae71eccceffd248b691c1a2 (patch)
tree5452036c673c9f8e6df5faec17bd25f311ed2ee3 /tests/auto
parent6b902b958a0923cb465270b3ee57ce0de6e4c3e2 (diff)
downloadqtlocation-0a32e757285ecc643ae71eccceffd248b691c1a2.tar.gz
Fix coordinate animation test.
The Map was starting at coordinate 0,0, which the test was not expecting. Fixed by disabling animation when setting the starting coordinate. Task-number: QTBUG-31797 Change-Id: I5cadb28ad667d321b2c3e6440e0698e0ad59ed8e Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative_ui/tst_map_coordinateanimation.qml16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/auto/declarative_ui/tst_map_coordinateanimation.qml b/tests/auto/declarative_ui/tst_map_coordinateanimation.qml
index 72c6aed8..54448973 100644
--- a/tests/auto/declarative_ui/tst_map_coordinateanimation.qml
+++ b/tests/auto/declarative_ui/tst_map_coordinateanimation.qml
@@ -59,7 +59,13 @@ Item {
plugin: testPlugin
width: 100
height: 100
- Behavior on center { CoordinateAnimation { duration: animationDuration } }
+
+ Behavior on center {
+ id: centerBehavior
+
+ enabled: false
+ CoordinateAnimation { duration: animationDuration }
+ }
onCenterChanged: {
if (!coordinateList) {
@@ -101,8 +107,14 @@ Item {
var delta = (toMerc.latitude - fromMerc.latitude) / (toMerc.longitude - fromMerc.longitude)
+ // Set from coordinate with animation disabled.
map.center = QtPositioning.coordinate(from.latitude, from.longitude)
- wait(animationDuration * 2)
+
+ // Expect only one update
+ compare(coordinateList.length, 1)
+
+ // Set to coordinate with animation enabled
+ centerBehavior.enabled = true
map.center = QtPositioning.coordinate(to.latitude, to.longitude)
wait(animationDuration * 2)