X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-TapGestureDetector.cpp;h=09f176f1e3ffa14da950a88fb748f054d802b8d8;hb=5799cbf8844641f30b7cd1222413f01fab49d527;hp=5c15b92bda361c4ac672ee2b050603250fe8a6a2;hpb=8c402c78a432d37a957e41982e37cb97e8b1580a;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp index 5c15b92..09f176f 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp @@ -18,7 +18,10 @@ #include #include #include +#include #include +#include +#include #include #include #include @@ -1331,3 +1334,51 @@ int UtcDaliTapGestureDetectorCheck(void) END_TEST; } + +int UtcDaliTapGestureFeedTouch(void) +{ + TestApplication application; + Integration::Scene scene = application.GetScene(); + RenderTaskList taskList = scene.GetRenderTaskList(); + Dali::RenderTask task = taskList.GetTask(0); + + Actor parentActor = Actor::New(); + parentActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + parentActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + + Actor childActor = Actor::New(); + childActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + childActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); + + parentActor.Add(childActor); + application.GetScene().Add(parentActor); + + // Render and notify + application.SendNotification(); + application.Render(); + + SignalData pData; + GestureReceivedFunctor pFunctor(pData); + + TapGestureDetector parentDetector = TapGestureDetector::New(); + parentDetector.DetectedSignal().Connect(&application, pFunctor); + + Integration::TouchEvent tp = GenerateSingleTouch(PointState::DOWN, Vector2(50.0f, 50.0f), 1, 100); + Internal::TouchEventPtr touchEventImpl(new Internal::TouchEvent(100)); + touchEventImpl->AddPoint(tp.GetPoint(0)); + touchEventImpl->SetRenderTask(task); + Dali::TouchEvent touchEventHandle(touchEventImpl.Get()); + parentDetector.FeedTouch(parentActor, touchEventHandle); + + tp = GenerateSingleTouch(PointState::UP, Vector2(50.0f, 50.0f), 1, 150); + touchEventImpl = new Internal::TouchEvent(150); + touchEventImpl->AddPoint(tp.GetPoint(0)); + touchEventImpl->SetRenderTask(task); + touchEventHandle = Dali::TouchEvent(touchEventImpl.Get()); + parentDetector.FeedTouch(parentActor, touchEventHandle); + + DALI_TEST_EQUALS(true, pData.functorCalled, TEST_LOCATION); + pData.Reset(); + + END_TEST; +}