X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-TapGestureRecognizer.cpp;h=e33a21c07f0b99cb1e4861eb8a2b604d0d6060ca;hb=596dfee38d336a562d1aeb7a889988d9de4c7eef;hp=e39e244c200b76478f9e44efb135e88f81d6913c;hpb=0dec86f2b264d546ae2ef7b917917972645e68a2;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp b/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp index e39e244..e33a21c 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureRecognizer.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -563,3 +564,59 @@ int UtcDaliTapGestureRecognizerTripleTap(void) END_TEST; } + +int UtcDaliTapGestureSetMaximumAllowedTime(void) +{ + TestApplication application; + + TapGestureDetector detector = TapGestureDetector::New(2); + + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + application.GetScene().Add(actor); + + // Render and notify + application.SendNotification(); + application.Render(); + + detector.Attach(actor); + + try + { + Integration::SetTapMaximumAllowedTime(0); + } + catch(...) + { + DALI_TEST_CHECK(false); // Should not get here + } + + // Reduce the maximum allowable time. 500 -> 100 + Integration::SetTapMaximumAllowedTime(100); + + SignalData data; + GestureReceivedFunctor functor(data); + detector.DetectedSignal().Connect(&application, functor); + + application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 150)); + + application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 20.0f), 200)); + + application.SendNotification(); + + DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + + application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 250)); + + application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 20.0f), 300)); + + application.SendNotification(); + + // The double tap fails because the maximum allowed time has been exceeded + DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION); + + // reset maximum allowed time + Integration::SetTapMaximumAllowedTime(500); + + END_TEST; +}