Remove HitTest Devel API for RenderTask.
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-PanGestureDetector.cpp
index 1db4833..0cbc64d 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali/integration-api/profiling.h>
 #include <dali/integration-api/input-options.h>
 #include <dali-test-suite-utils.h>
@@ -131,7 +131,8 @@ struct TouchEventFunctor
 struct ConstraintData
 {
   ConstraintData()
-  : called(false)
+  : panning( false ),
+    called( false )
   {
   }
 
@@ -141,11 +142,13 @@ struct ConstraintData
   Vector2 localPosition;
   Vector2 localDisplacement;
   Vector2 localVelocity;
+  bool panning;
   bool called;
 
   void Reset()
   {
     screenPosition = screenDisplacement = screenVelocity = localPosition = localDisplacement = localVelocity = Vector2::ZERO;
+    panning = false;
     called = false;
   }
 };
@@ -163,6 +166,7 @@ struct PanConstraint
     constraintData.localPosition = inputs[3]->GetVector2();
     constraintData.localDisplacement = inputs[4]->GetVector2();
     constraintData.localVelocity = inputs[5]->GetVector2();
+    constraintData.panning = inputs[6]->GetBoolean();
     constraintData.called = true;
     current = Vector3::ZERO;
   }
@@ -245,28 +249,36 @@ static void SendPan(TestApplication& application, Gesture::State state, const Ve
   LastTime += PAN_EVENT_TIME_DELTA;
 }
 
-static Vector2 PerformSwipeGestureSwipe(TestApplication& application, Vector2 start, Vector2 direction, int frames, bool finish = true)
+static Vector2 PerformSwipeGestureSwipe(TestApplication& application, Vector2 startPosition, Vector2 direction, int frames, int eventsPerFrame,
+                                        bool start, bool finish, unsigned int renderInterval = TestApplication::DEFAULT_RENDER_INTERVAL)
 {
   // Now do a pan starting from (start) and heading (direction)
-  Vector2 pos(start);
-  SendPan(application, Gesture::Possible, pos);
-  SendPan(application, Gesture::Started, pos);
-  application.SendNotification();
-  application.Render();
+  Vector2 pos(startPosition);
+
+  if( start )
+  {
+    SendPan(application, Gesture::Possible, pos);
+    SendPan(application, Gesture::Started, pos);
+    application.SendNotification();
+    application.Render(renderInterval);
+  }
 
   for(int i = 0;i<frames;i++)
   {
-    pos += direction; // Move in this direction
-    SendPan(application, Gesture::Continuing, pos);
+    for( int j = 0; j < eventsPerFrame; j++ )
+    {
+      pos += direction; // Move in this direction
+      SendPan(application, Gesture::Continuing, pos);
+    }
     application.SendNotification();
-    application.Render();
+    application.Render(renderInterval);
   }
 
   if(finish)
   {
     SendPan(application, Gesture::Finished, pos);
     application.SendNotification();
-    application.Render();
+    application.Render(renderInterval);
   }
 
   return pos;
@@ -290,7 +302,7 @@ int UtcDaliPanGestureDetectorCopyConstructorP(void)
 {
   TestApplication application;
 
-  PanGestureDetector detector = PanGestureDetector::New();;
+  PanGestureDetector detector = PanGestureDetector::New();
 
   PanGestureDetector copy( detector );
   DALI_TEST_CHECK( detector );
@@ -301,7 +313,7 @@ int UtcDaliPanGestureDetectorAssignmentOperatorP(void)
 {
   TestApplication application;
 
-  PanGestureDetector detector = PanGestureDetector::New();;
+  PanGestureDetector detector = PanGestureDetector::New();
 
   PanGestureDetector assign;
   assign = detector;
@@ -336,7 +348,10 @@ int UtcDaliPanGestureDetectorNew(void)
   application.Render();
 
   Integration::TouchEvent touchEvent(1);
-  TouchPoint point(1, TouchPoint::Down, 20.0f, 20.0f);
+  Integration::Point point;
+  point.SetDeviceId( 1 );
+  point.SetState( PointState::DOWN );
+  point.SetScreenPosition( Vector2( 20.0f, 20.0f ) );
   touchEvent.AddPoint(point);
   application.ProcessEvent(touchEvent);
   END_TEST;
@@ -1409,7 +1424,7 @@ int UtcDaliPanGestureEmitIncorrectState(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1588,162 +1603,15 @@ int UtcDaliPanGestureActorStagedAndDestroyed(void)
   END_TEST;
 }
 
-int UtcDaliPanGestureSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(actor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the actor's area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliPanGestureBehindTouchableSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set system-overlay actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set stage actor to receive the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(stageActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the two actors' area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoordsStart ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliPanGestureTouchBehindGesturedSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set stage actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set system-overlay actor to have the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(systemOverlayActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the two actors' area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoordsStart ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliPanGestureAngleHandling(void)
 {
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0u, TEST_LOCATION );
 
   detector.AddAngle( PanGestureDetector::DIRECTION_LEFT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1u, TEST_LOCATION );
   bool found = false;
   for( size_t i = 0; i < detector.GetAngleCount(); i++)
   {
@@ -1762,14 +1630,14 @@ int UtcDaliPanGestureAngleHandling(void)
   }
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2u, TEST_LOCATION );
 
   // Remove something not in the container.
   detector.RemoveAngle( PanGestureDetector::DIRECTION_UP );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2u, TEST_LOCATION );
 
   detector.RemoveAngle( PanGestureDetector::DIRECTION_RIGHT );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1u, TEST_LOCATION );
   for ( size_t i = 0; i < detector.GetAngleCount(); i++)
   {
     if ( detector.GetAngle(i).first == PanGestureDetector::DIRECTION_RIGHT )
@@ -1781,7 +1649,34 @@ int UtcDaliPanGestureAngleHandling(void)
   }
 
   detector.ClearAngles();
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0u, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliPanGestureGetAngle(void)
+{
+  TestApplication application;
+
+  PanGestureDetector detector = PanGestureDetector::New();
   DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_LEFT );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_UP );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 3, TEST_LOCATION );
+
+  detector.AddAngle( PanGestureDetector::DIRECTION_DOWN );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 4, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( detector.GetAngle(0).first,  PanGestureDetector::DIRECTION_LEFT, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(1).first,  PanGestureDetector::DIRECTION_RIGHT, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(2).first,  PanGestureDetector::DIRECTION_UP, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(3).first,  PanGestureDetector::DIRECTION_DOWN, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1795,7 +1690,7 @@ int UtcDaliPanGestureAngleOutOfRange(void)
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0u, TEST_LOCATION );
 
   //
   // Angle
@@ -1928,10 +1823,10 @@ int UtcDaliPanGestureDirectionHandling(void)
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0u, TEST_LOCATION );
 
   detector.AddDirection( PanGestureDetector::DIRECTION_LEFT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2u, TEST_LOCATION );
   bool found = false;
   for ( size_t i = 0; detector.GetAngleCount(); i++)
   {
@@ -1969,10 +1864,10 @@ int UtcDaliPanGestureDirectionHandling(void)
 
   // Remove something not in the container.
   detector.RemoveDirection( PanGestureDetector::DIRECTION_UP );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2u, TEST_LOCATION );
 
   detector.RemoveDirection( PanGestureDetector::DIRECTION_RIGHT );
-  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0u, TEST_LOCATION );
   END_TEST;
 }
 
@@ -2112,6 +2007,7 @@ int UtcDaliPanGestureNoPredictionNoSmoothing(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
   constraint.Apply();
 
   // Render and notify
@@ -2120,7 +2016,7 @@ int UtcDaliPanGestureNoPredictionNoSmoothing(void)
 
   Vector2 direction(Vector2::XAXIS * -5.0f);
   Vector2 startPosition( 1.0f, 1.0f );
-  PerformSwipeGestureSwipe(application, startPosition, direction, PAN_GESTURE_UPDATE_COUNT, true);
+  PerformSwipeGestureSwipe(application, startPosition, direction, PAN_GESTURE_UPDATE_COUNT, 1, true, true);
   DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.screenPosition, startPosition + (direction * PAN_GESTURE_UPDATE_COUNT), 0.1f, TEST_LOCATION );
@@ -2158,6 +2054,7 @@ int UtcDaliPanGestureNoPredictionSmoothing(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
   constraint.Apply();
 
   // Render and notify
@@ -2167,11 +2064,12 @@ int UtcDaliPanGestureNoPredictionSmoothing(void)
   Vector2 direction(Vector2::XAXIS * -5.0f);
   Vector2 previousPosition( 20.0f, 20.0f );
   Vector2 currentPosition( 20.0f, 10.0f );
-  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, true);
+  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, 1, true, true);
   DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(1.0f, 1.0f) + (direction * PAN_GESTURE_UPDATE_COUNT), 0.1f, TEST_LOCATION );
-  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(1.0f, 1.0f) + (direction * PAN_GESTURE_UPDATE_COUNT), 0.1f, TEST_LOCATION );
+  // Take into account resampling done when prediction is off.
+  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(1.0f, 1.0f) + (direction * (PAN_GESTURE_UPDATE_COUNT - 0.25f)), 0.15f, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(1.0f, 1.0f) + (direction * (PAN_GESTURE_UPDATE_COUNT - 0.25f)), 0.15f, TEST_LOCATION );
 
   constraintData.Reset();
   END_TEST;
@@ -2205,6 +2103,7 @@ int UtcDaliPanGesturePredictionNoSmoothing(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
   constraint.Apply();
 
   // Render and notify
@@ -2214,7 +2113,7 @@ int UtcDaliPanGesturePredictionNoSmoothing(void)
   Vector2 direction(Vector2::XAXIS * -1.0f);
   Vector2 previousPosition( 20.0f, 20.0f );
   Vector2 currentPosition( 20.0f, 10.0f );
-  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, true);
+  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, 1, true, true);
   DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(1.0f, 1.0f) + (direction * PAN_GESTURE_UPDATE_COUNT), 10.0f, TEST_LOCATION );
@@ -2224,7 +2123,7 @@ int UtcDaliPanGesturePredictionNoSmoothing(void)
   END_TEST;
 }
 
-int UtcDaliPanGesturePredictionSmoothing(void)
+int UtcDaliPanGesturePredictionSmoothing01(void)
 {
   TestApplication application;
   Integration::SetPanGesturePredictionMode(1);
@@ -2252,6 +2151,7 @@ int UtcDaliPanGesturePredictionSmoothing(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
   constraint.Apply();
 
   // Render and notify
@@ -2261,7 +2161,7 @@ int UtcDaliPanGesturePredictionSmoothing(void)
   Vector2 direction(Vector2::XAXIS * -1.0f);
   Vector2 previousPosition( 20.0f, 20.0f );
   Vector2 currentPosition( 20.0f, 10.0f );
-  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, true);
+  PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, 1, true, true);
   DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
   DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(1.0f, 1.0f) + (direction * PAN_GESTURE_UPDATE_COUNT), 10.0f, TEST_LOCATION );
@@ -2271,6 +2171,237 @@ int UtcDaliPanGesturePredictionSmoothing(void)
   END_TEST;
 }
 
+int UtcDaliPanGesturePredictionSmoothing02(void)
+{
+  TestApplication application;
+  Integration::SetPanGesturePredictionMode( 1 );
+  Integration::SetPanGestureMaximumPredictionAmount( 1 );
+  Integration::SetPanGesturePredictionAmountAdjustment( 2 );
+  Integration::SetPanGestureSmoothingMode( 1 );
+  Integration::SetPanGestureSmoothingAmount( 0.25f );
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Add a pan detector
+  PanGestureDetector detector = PanGestureDetector::New();
+  detector.Attach( actor );
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+  detector.DetectedSignal().Connect( &application, functor );
+
+  Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
+
+  ConstraintData constraintData;
+  Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
+  constraint.Apply();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Vector2 directionX(Vector2::XAXIS);
+  Vector2 directionY(Vector2::YAXIS);
+  Vector2 position = PerformSwipeGestureSwipe(application, Vector2(2.0f, 2.0f), directionX, 10, 1, true, false);
+  position = PerformSwipeGestureSwipe(application, position, directionX * 10.0f, 1, 1, false, false);
+  position = PerformSwipeGestureSwipe(application, position, directionX * -1.0f, 2, 1, false, false);
+  position = PerformSwipeGestureSwipe(application, position, directionX, 10, 1, false, true);
+  position = PerformSwipeGestureSwipe(application, position, directionY, 10, 1, true, false);
+  position = PerformSwipeGestureSwipe(application, position, directionY * -1.0f, 2, 1, false, false);
+  position = PerformSwipeGestureSwipe(application, position, directionY, 10, 1, false, true);
+  DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+
+  constraintData.Reset();
+  END_TEST;
+}
+
+int UtcDaliPanGesturePrediction2SmoothingMultiTap01(void)
+{
+  TestApplication application;
+
+  Integration::SetPanGesturePredictionMode( 2 );
+  Integration::SetPanGesturePredictionAmount( 57 );
+  Integration::SetPanGestureSmoothingMode( 2 );
+  Integration::SetPanGestureUseActualTimes( false );
+  Integration::SetPanGestureInterpolationTimeRange( 10 );
+  Integration::SetPanGestureScalarOnlyPredictionEnabled( false );
+  Integration::SetPanGestureTwoPointPredictionEnabled( true );
+  Integration::SetPanGestureTwoPointInterpolatePastTime( 42 );
+  Integration::SetPanGestureTwoPointVelocityBias( 0.35f );
+  Integration::SetPanGestureTwoPointAccelerationBias( 0.10f );
+  Integration::SetPanGestureMultitapSmoothingRange( 34 );
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Add a pan detector
+  PanGestureDetector detector = PanGestureDetector::New();
+  detector.Attach( actor );
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+  detector.DetectedSignal().Connect( &application, functor );
+
+  Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
+
+  ConstraintData constraintData;
+  Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
+  constraint.Apply();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Vector2 direction(Vector2::XAXIS * -1.0f);
+  Vector2 position = PerformSwipeGestureSwipe(application, Vector2(2.0f, 2.0f), direction, 10, 1, true, true);
+  DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+
+  constraintData.Reset();
+  END_TEST;
+}
+
+int UtcDaliPanGesturePrediction2SmoothingMultiTap02(void)
+{
+  TestApplication application;
+
+  Integration::SetPanGesturePredictionMode( 2 );
+  Integration::SetPanGestureSmoothingMode( 2 );
+  Integration::SetPanGestureUseActualTimes( true );
+  Integration::SetPanGestureInterpolationTimeRange( 10 );
+  Integration::SetPanGestureScalarOnlyPredictionEnabled( true );
+  Integration::SetPanGestureTwoPointPredictionEnabled( true );
+  Integration::SetPanGestureTwoPointInterpolatePastTime( 42 );
+  Integration::SetPanGestureTwoPointVelocityBias( 0.35f );
+  Integration::SetPanGestureTwoPointAccelerationBias( 0.10f );
+  Integration::SetPanGestureMultitapSmoothingRange( 34 );
+
+  Integration::EnableProfiling( Integration::PROFILING_TYPE_PAN_GESTURE );
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Add a pan detector
+  PanGestureDetector detector = PanGestureDetector::New();
+  detector.Attach( actor );
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+  detector.DetectedSignal().Connect( &application, functor );
+
+  Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
+
+  ConstraintData constraintData;
+  Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
+  constraint.Apply();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Vector2 direction(Vector2::XAXIS * -1.0f);
+  Vector2 position = PerformSwipeGestureSwipe(application, Vector2(2.0f, 2.0f), direction, 10, 3, true, false);
+  position = PerformSwipeGestureSwipe(application, position, direction, 10, 0, false, false);
+  position = PerformSwipeGestureSwipe(application, position, direction, 10, 1, false, false, 0);
+  position = PerformSwipeGestureSwipe(application, position, direction, 10, 1, false, true);
+  DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+
+  constraintData.Reset();
+  END_TEST;
+}
+
+int UtcDaliPanGesturePrediction2Smoothing(void)
+{
+  TestApplication application;
+
+  Integration::SetPanGesturePredictionMode( 2 );
+  Integration::SetPanGesturePredictionAmount( 57 );
+  Integration::SetPanGestureSmoothingMode( 1 );
+  Integration::SetPanGestureUseActualTimes( false );
+  Integration::SetPanGestureInterpolationTimeRange( 10 );
+  Integration::SetPanGestureScalarOnlyPredictionEnabled( true );
+  Integration::SetPanGestureTwoPointPredictionEnabled( true );
+  Integration::SetPanGestureTwoPointInterpolatePastTime( 42 );
+  Integration::SetPanGestureTwoPointVelocityBias( 0.35f );
+  Integration::SetPanGestureTwoPointAccelerationBias( 0.10f );
+  Integration::SetPanGestureMultitapSmoothingRange( 34 );
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Add a pan detector
+  PanGestureDetector detector = PanGestureDetector::New();
+  detector.Attach( actor );
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+  detector.DetectedSignal().Connect( &application, functor );
+
+  Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
+
+  ConstraintData constraintData;
+  Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
+  constraint.Apply();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Vector2 direction(Vector2::XAXIS * -1.0f);
+  Vector2 position = PerformSwipeGestureSwipe(application, Vector2(2.0f, 2.0f), direction, 10, 1, true, false);
+  position = PerformSwipeGestureSwipe(application, position, direction, 1, 3, false, false);
+  position = PerformSwipeGestureSwipe(application, position, direction, 5, 0, false, false);
+  position = PerformSwipeGestureSwipe(application, position, direction, 10, 1, false, true);
+  DALI_TEST_EQUALS( true,  data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.called, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.screenPosition, Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( constraintData.localPosition,  Vector2(2.0f, 2.0f) + position, 10.0f, TEST_LOCATION );
+
+  constraintData.Reset();
+  END_TEST;
+}
+
 int UtcDaliPanGestureSetProperties(void)
 {
   TestApplication application;
@@ -2291,6 +2422,7 @@ int UtcDaliPanGestureSetProperties(void)
   detector.DetectedSignal().Connect( &application, functor );
 
   Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
+  Property::Index animatableGestureProperty = detector.RegisterProperty( "Dummy Property", Vector3::ZERO ); // For code coverage
 
   ConstraintData constraintData;
   Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
@@ -2300,6 +2432,8 @@ int UtcDaliPanGestureSetProperties(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
+  constraint.AddSource( Source( detector, animatableGestureProperty ) );
   constraint.Apply();
 
   // Render and notify
@@ -2361,6 +2495,7 @@ int UtcDaliPanGestureSetPropertiesAlreadyPanning(void)
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
   constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+  constraint.AddSource( Source( detector, PanGestureDetector::Property::PANNING ) );
   constraint.Apply();
 
   // Render and notify
@@ -2401,6 +2536,107 @@ int UtcDaliPanGesturePropertyIndices(void)
   END_TEST;
 }
 
+namespace
+{
+struct PropertyStringIndex
+{
+  const char * const name;
+  const Property::Index index;
+  const Property::Type type;
+  const Property::Value value;
+};
+
+const PropertyStringIndex PROPERTY_TABLE[] =
+{
+  { "screenPosition",      PanGestureDetector::Property::SCREEN_POSITION,     Property::VECTOR2, Vector2::ZERO },
+  { "screenDisplacement",  PanGestureDetector::Property::SCREEN_DISPLACEMENT, Property::VECTOR2, Vector2::ZERO },
+  { "screenVelocity",      PanGestureDetector::Property::SCREEN_VELOCITY,     Property::VECTOR2, Vector2::ZERO },
+  { "localPosition",       PanGestureDetector::Property::LOCAL_POSITION,      Property::VECTOR2, Vector2::ZERO },
+  { "localDisplacement",   PanGestureDetector::Property::LOCAL_DISPLACEMENT,  Property::VECTOR2, Vector2::ZERO },
+  { "localVelocity",       PanGestureDetector::Property::LOCAL_VELOCITY,      Property::VECTOR2, Vector2::ZERO },
+  { "panning",             PanGestureDetector::Property::PANNING,             Property::BOOLEAN, false         },
+};
+const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
+} // unnamed namespace
+
+
+int UtcDaliPanGestureProperties(void)
+{
+  TestApplication application;
+  PanGestureDetector detector = PanGestureDetector::New();
+
+  for( unsigned int i = 0; i < PROPERTY_TABLE_COUNT; ++i )
+  {
+    DALI_TEST_EQUALS( detector.GetPropertyName( PROPERTY_TABLE[ i ].index ), std::string( PROPERTY_TABLE[ i ].name ), TEST_LOCATION );
+    DALI_TEST_EQUALS( detector.GetPropertyIndex( PROPERTY_TABLE[ i ].name ), PROPERTY_TABLE[ i ].index, TEST_LOCATION );
+    DALI_TEST_EQUALS( detector.GetPropertyType( PROPERTY_TABLE[ i ].index ), PROPERTY_TABLE[ i ].type, TEST_LOCATION );
+    DALI_TEST_EQUALS( detector.IsPropertyWritable( PROPERTY_TABLE[ i ].index ), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( detector.IsPropertyAnimatable( PROPERTY_TABLE[ i ].index ), false, TEST_LOCATION );
+    DALI_TEST_EQUALS( detector.IsPropertyAConstraintInput( PROPERTY_TABLE[ i ].index ), true, TEST_LOCATION );
+    detector.SetProperty( PROPERTY_TABLE[ i ].index, Property::Value() ); // Just for Coverage
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPanGestureGetProperty(void)
+{
+  TestApplication application;
+  PanGestureDetector detector = PanGestureDetector::New();
+
+  for( unsigned int i = 0; i < PROPERTY_TABLE_COUNT; ++i )
+  {
+    if( PROPERTY_TABLE[ i ].type == Property::VECTOR2 )
+    {
+      bool value = detector.GetProperty( PROPERTY_TABLE[ i ].index ).Get< bool >();
+      DALI_TEST_EQUALS( PROPERTY_TABLE[ i ].value.Get< bool >(), value, TEST_LOCATION );
+    }
+    else if( PROPERTY_TABLE[ i ].type == Property::BOOLEAN )
+    {
+      Vector2 value = detector.GetProperty( PROPERTY_TABLE[ i ].index ).Get< Vector2 >();
+      DALI_TEST_EQUALS( PROPERTY_TABLE[ i ].value.Get< Vector2 >(), value, TEST_LOCATION );
+    }
+  }
+
+  END_TEST;
+}
+
+int UtcDaliPanGestureGetPropertyWithSceneObject(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Add a pan detector
+  PanGestureDetector detector = PanGestureDetector::New();
+  detector.Attach( actor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  for( unsigned int i = 0; i < PROPERTY_TABLE_COUNT; ++i )
+  {
+    detector.SetProperty( PROPERTY_TABLE[ i ].index, Property::Value() ); // Just for Coverage
+
+    if( PROPERTY_TABLE[ i ].type == Property::VECTOR2 )
+    {
+      bool value = detector.GetProperty( PROPERTY_TABLE[ i ].index ).Get< bool >();
+      DALI_TEST_EQUALS( PROPERTY_TABLE[ i ].value.Get< bool >(), value, TEST_LOCATION );
+    }
+    else if( PROPERTY_TABLE[ i ].type == Property::BOOLEAN )
+    {
+      Vector2 value = detector.GetProperty( PROPERTY_TABLE[ i ].index ).Get< Vector2 >();
+      DALI_TEST_EQUALS( PROPERTY_TABLE[ i ].value.Get< Vector2 >(), value, TEST_LOCATION );
+    }
+  }
+
+  END_TEST;
+}
+
 int UtcDaliPanGestureLayerConsumesTouch(void)
 {
   TestApplication application;