@@ -67,6 +67,7 @@ private Q_SLOTS:
67 void maxSilenceTime();
67 void maxSilenceTime();
68 void sceneXAndX();
68 void sceneXAndX();
69 void sceneYAndY();
69 void sceneYAndY();
70+ void emitDraggingChangedOnDirectRecognition();
72 QQuickView *createView();
73 QQuickView *createView();
@@ -514,6 +515,37 @@ void tst_DirectionalDragArea::sceneYAndY()
514 QCOMPARE(edgeDragArea->touchSceneY(), touchScenePos.y());
515 QCOMPARE(edgeDragArea->touchSceneY(), touchScenePos.y());
519+ Emit draggingChanged() when status change from WaitingForTouch directly to Recognized.
520+ This happens when the gesture recognition is effectively disabled (e.g. by setting a
521+ distanceThreshold of zero)
523+void tst_DirectionalDragArea::emitDraggingChangedOnDirectRecognition()
525+ DirectionalDragArea *edgeDragArea =
526+ view->rootObject()->findChild<DirectionalDragArea*>("hpDragArea");
527+ QVERIFY(edgeDragArea != 0);
528+ edgeDragArea->setRecognitionTimer(fakeTimer);
529+ edgeDragArea->setTimeSource(fakeTimeSource);
531+ QPointF touchPos = calculateInitialTouchPos(edgeDragArea, view);
533+ QSignalSpy draggingSpy(edgeDragArea, SIGNAL(draggingChanged(bool)));
535+ // That will make it completetly skip the recognition phase ("Undecided" status).
536+ edgeDragArea->setDistanceThreshold(0.0);
538+ QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::WaitingForTouch);
539+ QCOMPARE(edgeDragArea->dragging(), false);
541+ fakeTimeSource->m_msecsSinceReference = 0;
542+ QTest::touchEvent(view, device).press(0, touchPos.toPoint());
544+ QCOMPARE((int)edgeDragArea->status(), (int)DirectionalDragArea::Recognized);
545+ QCOMPARE(draggingSpy.count(), 1);
546+ QCOMPARE(edgeDragArea->dragging(), true);
517QTEST_MAIN(tst_DirectionalDragArea)
549QTEST_MAIN(tst_DirectionalDragArea)
519#include "tst_DirectionalDragArea.moc"
551#include "tst_DirectionalDragArea.moc"