@@ -111,6 +111,11 @@ Item {
112 // Now do check that snapping is in fact enabled
112 // Now do check that snapping is in fact enabled
113 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
113 compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
115+ // Tests can be run in a reaaaaally slow environment or machine. Thus ensure
116+ // the dismissTimer doesn't time out inadvertently.
117+ var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
118+ dismissTimer.interval = 60 * 60 * 1000; // one hour
116 function dragLauncherIntoView() {
121 function dragLauncherIntoView() {
@@ -255,10 +260,21 @@ Item {
255 function test_clickFlick_data() {
260 function test_clickFlick_data() {
256 var listView = findChild(launcher, "launcherListView");
261 var listView = findChild(launcher, "launcherListView");
263+ {tag: "unfolded top", positionViewAtBeginning: false,
258− {tag: "unfolded top", flickSpeed: units.gu(200), clickY: listView.topMargin + units.gu(2), expectFlick: false},
264+ clickY: listView.topMargin + units.gu(2),
265+ expectFlick: false},
267+ {tag: "folded top", positionViewAtBeginning: true,
259− {tag: "folded top", flickSpeed: -units.gu(200), clickY: listView.topMargin + units.gu(2), expectFlick: true},
268+ clickY: listView.topMargin + units.gu(2),
271+ {tag: "unfolded bottom", positionViewAtBeginning: true,
260− {tag: "unfolded bottom", flickSpeed: -units.gu(200), clickY: listView.height - listView.topMargin - units.gu(1), expectFlick: false},
272+ clickY: listView.height - listView.topMargin - units.gu(1),
273+ expectFlick: false},
275+ {tag: "folded bottom", positionViewAtBeginning: false,
261− {tag: "folded bottom", flickSpeed: units.gu(200), clickY: listView.height - listView.topMargin - units.gu(1), expectFlick: true},
276+ clickY: listView.height - listView.topMargin - units.gu(1),
@@ -267,7 +283,15 @@ Item {
267 dragLauncherIntoView();
283 dragLauncherIntoView();
268 var listView = findChild(launcher, "launcherListView");
284 var listView = findChild(launcher, "launcherListView");
270− listView.flick(0, data.flickSpeed);
286+ // flicking is unreliable. sometimes it works, sometimes the
287+ // list view moves just a tiny bit or not at all, making tests fail.
288+ // So for stability's sake we just put the listView in the position
289+ // we want to to actually start doing what this tests intends to check.
290+ if (data.positionViewAtBeginning) {
291+ listView.positionViewAtBeginning();
293+ listView.positionViewAtEnd();
271 tryCompare(listView, "flicking", false);
295 tryCompare(listView, "flicking", false);
273 var oldY = listView.contentY;
297 var oldY = listView.contentY;