@@ -297,4 +297,29 @@ TestCase {
297297 event.release(0 /* touchId */, x, y)
298298 event.commit()
299299 }
300+
301+ /*
302+ In qmltests, sequences of touch events are sent all at once, unlike in "real life".
303+ Also qmltests might run really slowly, e.g. when run from inside virtual machines.
304+ Thus to remove a variable that qmltests cannot really control, namely time, this
305+ function removes all constraints from DirectionalDragAreas that are sensible to
306+ elapsed time.
307+
308+ This effectively makes DirectionalDragAreas easier to fool.
309+ */
310+ function removeTimeConstraintsFromDirectionalDragAreas(item) {
311+
312+ // use duck-typing to identify a DirectionalDragArea
313+ if (item.minSpeed != undefined
314+ && item.maxSilenceTime != undefined
315+ && item.compositionTime != undefined) {
316+ item.minSpeed = 0;
317+ item.maxSilenceTime = 60 * 60 * 1000;
318+ item.compositionTime = 0;
319+ } else {
320+ for (var i in item.children) {
321+ removeTimeConstraintsFromDirectionalDragAreas(item.children[i]);
322+ }
323+ }
324+ }
300325}