Revert "Revert "Revert "[Tizen] Revert "Use touch consumed return to set whether...
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-LongPressGestureDetector.cpp
index e0f68d5..e179f2d 100644 (file)
  *
  */
 
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
+#include <dali-test-suite-utils.h>
+#include <dali/devel-api/events/long-press-gesture-detector-devel.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/input-options.h>
 #include <dali/integration-api/render-task-list-integ.h>
-#include <dali/devel-api/events/long-press-gesture-detector-devel.h>
-#include <dali-test-suite-utils.h>
-#include <test-touch-utils.h>
+#include <dali/public-api/dali-core.h>
+#include <stdlib.h>
+#include <test-touch-event-utils.h>
+
+#include <iostream>
 
 using namespace Dali;
 
@@ -41,45 +41,46 @@ void utc_dali_long_press_gesture_detector_cleanup(void)
 ///////////////////////////////////////////////////////////////////////////////
 namespace
 {
-
 // Stores data that is populated in the callback and will be read by the TET cases
 struct SignalData
 {
   SignalData()
-  : functorCalled( false ),
-    voidFunctorCalled( false ),
-    receivedGesture( Gesture::Clear ),
+  : functorCalled(false),
+    voidFunctorCalled(false),
+    receivedGesture(),
     pressedActor()
-  {}
+  {
+  }
 
   void Reset()
   {
-    functorCalled = false;
+    functorCalled     = false;
     voidFunctorCalled = false;
 
-    receivedGesture.numberOfTouches = 0u;
-    receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     pressedActor.Reset();
   }
 
-  bool functorCalled;
-  bool voidFunctorCalled;
+  bool             functorCalled;
+  bool             voidFunctorCalled;
   LongPressGesture receivedGesture;
-  Actor pressedActor;
+  Actor            pressedActor;
 };
 
 // Functor that sets the data when called
 struct GestureReceivedFunctor
 {
-  GestureReceivedFunctor(SignalData& data) : signalData(data) { }
+  GestureReceivedFunctor(SignalData& data)
+  : signalData(data)
+  {
+  }
 
   void operator()(Actor actor, const LongPressGesture& longPress)
   {
-    signalData.functorCalled = true;
+    signalData.functorCalled   = true;
     signalData.receivedGesture = longPress;
-    signalData.pressedActor = actor;
+    signalData.pressedActor    = actor;
   }
 
   void operator()()
@@ -93,48 +94,46 @@ struct GestureReceivedFunctor
 // Functor that removes the gestured actor from stage
 struct UnstageActorFunctor : public GestureReceivedFunctor
 {
-  UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
-  : GestureReceivedFunctor( data ),
-    stateToUnstage( stateToUnstage ),
-    scene( scene )
+  UnstageActorFunctor(SignalData& data, GestureState& stateToUnstage, Integration::Scene scene)
+  : GestureReceivedFunctor(data),
+    stateToUnstage(stateToUnstage),
+    scene(scene)
   {
   }
 
-  void operator()( Actor actor, const LongPressGesture& longPress )
+  void operator()(Actor actor, const LongPressGesture& longPress)
   {
-    GestureReceivedFunctor::operator()( actor, longPress );
+    GestureReceivedFunctor::operator()(actor, longPress);
 
-    if ( longPress.state == stateToUnstage )
+    if(longPress.GetState() == stateToUnstage)
     {
-      scene.Remove( actor );
+      scene.Remove(actor);
     }
   }
 
-  Gesture::State& stateToUnstage;
+  GestureState&      stateToUnstage;
   Integration::Scene scene;
 };
 
 // Functor for receiving a touch event
 struct TouchEventFunctor
 {
-  bool operator()(Actor actor, const TouchEvent& touch)
+  bool operator()(Actor actor, Dali::TouchEvent touch)
   {
     //For line coverage
     unsigned int points = touch.GetPointCount();
-    if( points > 0)
+    if(points > 0)
     {
-      const TouchPoint& touchPoint = touch.GetPoint(0);
-      tet_printf("Touch Point state = %d\n", touchPoint.state);
+      tet_printf("Touch Point state = %d\n", touch.GetState(0));
     }
     return false;
   }
 };
 
-} // anon namespace
+} // namespace
 
 ///////////////////////////////////////////////////////////////////////////////
 
-
 // Positive test case for a method
 int UtcDaliLongPressGestureDetectorConstructorP(void)
 {
@@ -149,10 +148,11 @@ int UtcDaliLongPressGestureDetectorCopyConstructorP(void)
 {
   TestApplication application;
 
-  LongPressGestureDetector detector = LongPressGestureDetector::New();;
+  LongPressGestureDetector detector = LongPressGestureDetector::New();
+  ;
 
-  LongPressGestureDetector copy( detector );
-  DALI_TEST_CHECK( detector );
+  LongPressGestureDetector copy(detector);
+  DALI_TEST_CHECK(detector);
   END_TEST;
 }
 
@@ -161,13 +161,14 @@ int UtcDaliLongPressGestureDetectorAssignmentOperatorP(void)
   TestApplication application;
 
   LongPressGestureDetector detector;
-  detector = LongPressGestureDetector::New();;
+  detector = LongPressGestureDetector::New();
+  ;
 
   LongPressGestureDetector copy;
   copy = detector;
-  DALI_TEST_CHECK( detector );
+  DALI_TEST_CHECK(detector);
 
-  DALI_TEST_CHECK( detector == copy );
+  DALI_TEST_CHECK(detector == copy);
   END_TEST;
 }
 
@@ -198,8 +199,8 @@ int UtcDaliLongPressGestureDetectorNew(void)
 
   // Attach an actor and emit a touch event on the actor to ensure complete line coverage
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -212,10 +213,10 @@ int UtcDaliLongPressGestureDetectorNew(void)
   actor.TouchedSignal().Connect(&application, touchFunctor);
 
   Integration::TouchEvent touchEvent(1);
-  Integration::Point point;
-  point.SetDeviceId( 1 );
-  point.SetState( PointState::DOWN );
-  point.SetScreenPosition( Vector2( 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);
 
@@ -223,8 +224,6 @@ int UtcDaliLongPressGestureDetectorNew(void)
   application.SendNotification();
   application.Render();
 
-  // For line coverage, Initialise default constructor
-  TouchEvent touchEvent2;
   END_TEST;
 }
 
@@ -240,17 +239,17 @@ int UtcDaliLongPressGestureDetectorDownCast(void)
   LongPressGestureDetector detector2 = LongPressGestureDetector::DownCast(object);
   DALI_TEST_CHECK(detector2);
 
-  LongPressGestureDetector detector3 = DownCast< LongPressGestureDetector >(object);
+  LongPressGestureDetector detector3 = DownCast<LongPressGestureDetector>(object);
   DALI_TEST_CHECK(detector3);
 
-  BaseHandle unInitializedObject;
+  BaseHandle               unInitializedObject;
   LongPressGestureDetector detector4 = LongPressGestureDetector::DownCast(unInitializedObject);
   DALI_TEST_CHECK(!detector4);
 
-  LongPressGestureDetector detector5 = DownCast< LongPressGestureDetector >(unInitializedObject);
+  LongPressGestureDetector detector5 = DownCast<LongPressGestureDetector>(unInitializedObject);
   DALI_TEST_CHECK(!detector5);
 
-  GestureDetector detector6 = LongPressGestureDetector::New();
+  GestureDetector          detector6 = LongPressGestureDetector::New();
   LongPressGestureDetector detector7 = LongPressGestureDetector::DownCast(detector6);
   DALI_TEST_CHECK(detector7);
   END_TEST;
@@ -279,15 +278,15 @@ int UtcDaliLongPressGestureSignalReceptionNegative(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -295,8 +294,8 @@ int UtcDaliLongPressGestureSignalReceptionNegative(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Do a long press outside actor's area
-  TestGenerateLongPress( application, 112.0f, 112.0f );
-  TestEndLongPress( application, 112.0f, 112.0f);
+  TestGenerateLongPress(application, 112.0f, 112.0f);
+  TestEndLongPress(application, 112.0f, 112.0f);
 
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
@@ -307,15 +306,15 @@ int UtcDaliLongPressGestureSignalReceptionPositive(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -323,11 +322,11 @@ int UtcDaliLongPressGestureSignalReceptionPositive(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Do a long press inside actor's area
-  TestGenerateLongPress( application, 50.0f, 50.0f );
+  TestGenerateLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
-  TestEndLongPress( application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
+  TestEndLongPress(application, 50.0f, 50.0f);
   END_TEST;
 }
 
@@ -336,15 +335,15 @@ int UtcDaliLongPressGestureSignalReceptionDetach(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -352,28 +351,28 @@ int UtcDaliLongPressGestureSignalReceptionDetach(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Start long press within the actor's area
-  TestGenerateLongPress( application, 20.0f, 20.0f );
+  TestGenerateLongPress(application, 20.0f, 20.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(20.0f, 20.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
-  TestEndLongPress( application, 20.0f, 20.0f);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
+  TestEndLongPress(application, 20.0f, 20.0f);
 
   // repeat the long press within the actor's area - we should still receive the signal
   data.Reset();
-  TestGenerateLongPress( application, 50.0f, 50.0f );
+  TestGenerateLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(50.0f, 50.0f), data.receivedGesture.localPoint, 0.1, TEST_LOCATION);
-  TestEndLongPress( application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetLocalPoint(), 0.1, TEST_LOCATION);
+  TestEndLongPress(application, 50.0f, 50.0f);
 
   // Detach actor
   detector.DetachAll();
 
   // Ensure we are no longer signalled
   data.Reset();
-  TestGenerateLongPress( application, 20.0f, 20.0f );
+  TestGenerateLongPress(application, 20.0f, 20.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-  TestEndLongPress( application, 50.0f, 50.0f);
+  TestEndLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -382,7 +381,7 @@ int UtcDaliLongPressGestureSignalReceptionActorDestroyedDuringLongPress(void)
 {
   TestApplication application;
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -391,8 +390,8 @@ int UtcDaliLongPressGestureSignalReceptionActorDestroyedDuringLongPress(void)
   // Actor lifetime is scoped
   {
     Actor actor = Actor::New();
-    actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-    actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+    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
@@ -402,7 +401,7 @@ int UtcDaliLongPressGestureSignalReceptionActorDestroyedDuringLongPress(void)
     detector.Attach(actor);
 
     // Start long press within the actor's area
-    TestGenerateLongPress( application, 20.0f, 20.0f );
+    TestGenerateLongPress(application, 20.0f, 20.0f);
     DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
 
     // Remove the actor from stage and reset the data
@@ -416,7 +415,7 @@ int UtcDaliLongPressGestureSignalReceptionActorDestroyedDuringLongPress(void)
   // Actor should now have been destroyed
 
   data.Reset();
-  TestEndLongPress( application, 20.0f, 20.0f);
+  TestEndLongPress(application, 20.0f, 20.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -426,15 +425,15 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::Degree(90.0f), Vector3::ZAXIS ) );
+  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS));
   application.GetScene().Add(actor);
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -442,34 +441,34 @@ int UtcDaliLongPressGestureSignalReceptionRotatedActor(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Do a long press
-  TestGenerateLongPress( application, 5.0f, 5.0f );
-  TestEndLongPress( application, 5.0f, 5.0f);
+  TestGenerateLongPress(application, 5.0f, 5.0f);
+  TestEndLongPress(application, 5.0f, 5.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
-  actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
+  actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS));
   application.SendNotification();
   application.Render();
 
   // Do another long press, should still receive event
   data.Reset();
-  TestGenerateLongPress( application, 5.0f, 5.0f );
-  TestEndLongPress( application, 5.0f, 5.0f);
+  TestGenerateLongPress(application, 5.0f, 5.0f);
+  TestEndLongPress(application, 5.0f, 5.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  DALI_TEST_EQUALS(1u, data.receivedGesture.numberOfTouches, TEST_LOCATION);
-  DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, data.receivedGesture.GetNumberOfTouches(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(5.0f, 5.0f), data.receivedGesture.GetScreenPoint(), 0.1, TEST_LOCATION);
 
   // Rotate actor again and render
-  actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
+  actor.SetProperty(Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS));
   application.SendNotification();
   application.Render();
 
   // Do a long press, inside where the actor used to be, Should not receive the event
   data.Reset();
-  TestGenerateLongPress( application, 70.0f, 70.0f );
-  TestEndLongPress( application, 70.0f, 70.0f);
+  TestGenerateLongPress(application, 70.0f, 70.0f);
+  TestEndLongPress(application, 70.0f, 70.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -479,28 +478,25 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
   TestApplication application;
 
   Actor parent = Actor::New();
-  parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  parent.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  parent.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(parent);
 
   // Set child to completely cover parent.
   // Change rotation of child to be different from parent so that we can check if our local coordinate
   // conversion of the parent actor is correct.
   Actor child = Actor::New();
-  child.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
-  child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
-  child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
+  child.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  child.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  child.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  child.SetProperty(Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS));
   parent.Add(child);
 
-  TouchEventFunctor touchFunctor;
-  child.TouchedSignal().Connect(&application, touchFunctor);
-
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -508,11 +504,11 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // Do long press - hits child area but parent should still receive it
-  TestGenerateLongPress( application, 50.0f, 50.0f );
-  TestEndLongPress( application, 50.0f, 50.0f);
+  TestGenerateLongPress(application, 50.0f, 50.0f);
+  TestEndLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, parent == data.pressedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(50.0f, 50.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
 
   // Attach child and generate same touch points
   // (Also proves that you can detach and then re-attach another actor)
@@ -521,11 +517,11 @@ int UtcDaliLongPressGestureSignalReceptionChildHit(void)
 
   // Do an entire long press, only check finished value
   data.Reset();
-  TestGenerateLongPress( application, 51.0f, 51.0f );
-  TestEndLongPress( application, 51.0f, 51.0f);
+  TestGenerateLongPress(application, 51.0f, 51.0f);
+  TestEndLongPress(application, 51.0f, 51.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, child == data.pressedActor, TEST_LOCATION);
-  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.screenPoint, 0.01f, TEST_LOCATION);
+  DALI_TEST_EQUALS(Vector2(51.0f, 51.0f), data.receivedGesture.GetScreenPoint(), 0.01f, TEST_LOCATION);
   END_TEST;
 }
 
@@ -534,21 +530,21 @@ int UtcDaliLongPressGestureSignalReceptionAttachDetachMany(void)
   TestApplication application;
 
   Actor first = Actor::New();
-  first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  first.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  first.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(first);
 
   Actor second = Actor::New();
-  second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  second.SetProperty( Actor::Property::POSITION_X, 100.0f);
-  second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  second.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  second.SetProperty(Actor::Property::POSITION_X, 100.0f);
+  second.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(second);
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -557,15 +553,15 @@ int UtcDaliLongPressGestureSignalReceptionAttachDetachMany(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // LongPress within second actor's area
-  TestGenerateLongPress( application, 120.0f, 10.0f );
-  TestEndLongPress( application, 120.0f, 10.0f);
+  TestGenerateLongPress(application, 120.0f, 10.0f);
+  TestEndLongPress(application, 120.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, second == data.pressedActor, TEST_LOCATION);
 
   // LongPress within first actor's area
   data.Reset();
-  TestGenerateLongPress( application, 20.0f, 10.0f );
-  TestEndLongPress( application, 20.0f, 10.0f);
+  TestGenerateLongPress(application, 20.0f, 10.0f);
+  TestEndLongPress(application, 20.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, first == data.pressedActor, TEST_LOCATION);
 
@@ -574,14 +570,14 @@ int UtcDaliLongPressGestureSignalReceptionAttachDetachMany(void)
 
   // second actor shouldn't receive event
   data.Reset();
-  TestGenerateLongPress( application, 120.0f, 10.0f );
-  TestEndLongPress( application, 120.0f, 10.0f);
+  TestGenerateLongPress(application, 120.0f, 10.0f);
+  TestEndLongPress(application, 120.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // first actor should continue receiving event
   data.Reset();
-  TestGenerateLongPress( application, 20.0f, 10.0f );
-  TestEndLongPress( application, 20.0f, 10.0f);
+  TestGenerateLongPress(application, 20.0f, 10.0f);
+  TestEndLongPress(application, 20.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -591,15 +587,15 @@ int UtcDaliLongPressGestureSignalReceptionActorBecomesUntouchable(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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();
 
-  SignalData data;
+  SignalData             data;
   GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
@@ -607,12 +603,12 @@ int UtcDaliLongPressGestureSignalReceptionActorBecomesUntouchable(void)
   detector.DetectedSignal().Connect(&application, functor);
 
   // LongPress in actor's area
-  TestGenerateLongPress( application, 50.0f, 10.0f );
-  TestEndLongPress( application, 50.0f, 10.0f);
+  TestGenerateLongPress(application, 50.0f, 10.0f);
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
 
   // Actor becomes invisible - actor should not receive the next long press
-  actor.SetProperty( Actor::Property::VISIBLE,false);
+  actor.SetProperty(Actor::Property::VISIBLE, false);
 
   // Render and notify
   application.SendNotification();
@@ -620,8 +616,8 @@ int UtcDaliLongPressGestureSignalReceptionActorBecomesUntouchable(void)
 
   // LongPress in the same area, shouldn't receive event
   data.Reset();
-  TestGenerateLongPress( application, 50.0f, 10.0f );
-  TestEndLongPress( application, 50.0f, 10.0f);
+  TestGenerateLongPress(application, 50.0f, 10.0f);
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -631,8 +627,8 @@ int UtcDaliLongPressGestureSignalReceptionMultipleDetectorsOnActor(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -640,21 +636,21 @@ int UtcDaliLongPressGestureSignalReceptionMultipleDetectorsOnActor(void)
   application.Render();
 
   // Attach actor to one detector
-  SignalData firstData;
-  GestureReceivedFunctor firstFunctor(firstData);
+  SignalData               firstData;
+  GestureReceivedFunctor   firstFunctor(firstData);
   LongPressGestureDetector firstDetector = LongPressGestureDetector::New();
   firstDetector.Attach(actor);
   firstDetector.DetectedSignal().Connect(&application, firstFunctor);
 
   // Attach actor to another detector
-  SignalData secondData;
-  GestureReceivedFunctor secondFunctor(secondData);
+  SignalData               secondData;
+  GestureReceivedFunctor   secondFunctor(secondData);
   LongPressGestureDetector secondDetector = LongPressGestureDetector::New();
   secondDetector.Attach(actor);
   secondDetector.DetectedSignal().Connect(&application, secondFunctor);
 
   // LongPress in actor's area - both detector's functors should be called
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, firstData.functorCalled, TEST_LOCATION);
   DALI_TEST_EQUALS(true, secondData.functorCalled, TEST_LOCATION);
   END_TEST;
@@ -665,8 +661,8 @@ int UtcDaliLongPressGestureSignalReceptionDifferentPossible(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -674,47 +670,47 @@ int UtcDaliLongPressGestureSignalReceptionDifferentPossible(void)
   application.Render();
 
   // Attach actor to detector
-  SignalData data;
-  GestureReceivedFunctor functor( data );
+  SignalData               data;
+  GestureReceivedFunctor   functor(data);
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
   // LongPress possible in actor's area.
-  TestStartLongPress( application, 50.0f, 10.0f );
+  TestStartLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // Move actor somewhere else
-  actor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
+  actor.SetProperty(Actor::Property::POSITION, Vector2(100.0f, 100.0f));
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Emit Started event, we should not receive the long press.
-  TestTriggerLongPress( application );
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestTriggerLongPress(application);
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // LongPress possible in empty area.
-  TestStartLongPress( application, 50.0f, 10.0f );
+  TestStartLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // Move actor in to the long press position.
-  actor.SetProperty( Actor::Property::POSITION, Vector2( 0.0f, 0.0f ));
+  actor.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
-  // Emit Started event, we should not receive the long press.
-  TestTriggerLongPress( application );
-  TestEndLongPress( application, 50.0f, 10.0f );
+  // Emit STARTED event, we should not receive the long press.
+  TestTriggerLongPress(application);
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // Normal long press in actor's area for completeness.
-  TestGenerateLongPress( application, 50.0f, 10.0f );
-  TestEndLongPress( application, 50.0f, 10.0f);
+  TestGenerateLongPress(application, 50.0f, 10.0f);
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -724,8 +720,8 @@ int UtcDaliLongPressGesturePossibleCancelled(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -733,16 +729,16 @@ int UtcDaliLongPressGesturePossibleCancelled(void)
   application.Render();
 
   // Attach actor to detector
-  SignalData data;
-  GestureReceivedFunctor functor( data );
+  SignalData               data;
+  GestureReceivedFunctor   functor(data);
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
   // Send a possible followed by a cancel, we should not be signalled
-  TestStartLongPress( application, 50.0f, 10.0f );
+  TestStartLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
-  TestMovePan( application, Vector2( 50.0f, 10.0f ) );
+  TestMovePan(application, Vector2(50.0f, 10.0f));
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -752,8 +748,8 @@ int UtcDaliLongPressGestureDetachAfterStarted(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -761,22 +757,22 @@ int UtcDaliLongPressGestureDetachAfterStarted(void)
   application.Render();
 
   // Attach actor to detector
-  SignalData data;
-  GestureReceivedFunctor functor( data );
+  SignalData               data;
+  GestureReceivedFunctor   functor(data);
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
   // Emit initial signal
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
   // Detach actor
   detector.Detach(actor);
 
-  // Emit Finished, no signal
-  TestEndLongPress( application, 50.0f, 10.0f );
+  // Emit FINISHED, no signal
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -786,8 +782,8 @@ int UtcDaliLongPressGestureActorUnstaged(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  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
@@ -795,20 +791,20 @@ int UtcDaliLongPressGestureActorUnstaged(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage(GestureState::STARTED);
 
   // Attach actor to detector
-  SignalData data;
-  UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
+  SignalData               data;
+  UnstageActorFunctor      functor(data, stateToUnstage, application.GetScene());
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
   // Emit signals
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
-  TestEndLongPress( application, 50.0f, 10.0f );
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
 
   // Render and notify
@@ -822,16 +818,16 @@ int UtcDaliLongPressGestureActorUnstaged(void)
   application.SendNotification();
   application.Render();
 
-  // Change state to Gesture::Continuing to remove
-  stateToUnstage = Gesture::Finished;
+  // Change state to GestureState::CONTINUING to remove
+  stateToUnstage = GestureState::FINISHED;
 
   // Emit signals
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
-  TestEndLongPress( application, 50.0f, 10.0f );
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
-  tet_result( TET_PASS ); // If we get here then we have handled actor stage removal gracefully.
+  tet_result(TET_PASS); // If we get here then we have handled actor stage removal gracefully.
   END_TEST;
 }
 
@@ -840,15 +836,15 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(actor);
 
   // Create and add a second actor so that GestureDetector destruction does not come into play.
-  Actor dummyActor( Actor::New() );
-  dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
-  dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  Actor dummyActor(Actor::New());
+  dummyActor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  dummyActor.SetProperty(Actor::Property::POSITION, Vector2(100.0f, 100.0f));
+  dummyActor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(dummyActor);
 
   // Render and notify
@@ -856,22 +852,22 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // State to remove actor in.
-  Gesture::State stateToUnstage( Gesture::Started );
+  GestureState stateToUnstage(GestureState::STARTED);
 
   // Attach actor to detector
-  SignalData data;
-  UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
+  SignalData               data;
+  UnstageActorFunctor      functor(data, stateToUnstage, application.GetScene());
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
   detector.Attach(dummyActor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
-  // Here we are testing a Started actor which is removed in the Started callback, but then added back
+  // Here we are testing a STARTED actor which is removed in the STARTED callback, but then added back
   // before we get a finished state.  As we were removed from the stage, even if we're at the same
   // position, we should still not be signalled.
 
   // Emit signals
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
@@ -887,14 +883,14 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // Continue signal emission
-  TestEndLongPress( application, 50.0f, 10.0f );
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
   // Here we delete an actor in started, we should not receive any subsequent signalling.
 
   // Emit signals
-  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestGenerateLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
@@ -910,7 +906,7 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   application.Render();
 
   // Continue signal emission
-  TestEndLongPress( application, 50.0f, 10.0f );
+  TestEndLongPress(application, 50.0f, 10.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -920,22 +916,22 @@ int UtcDaliLongPressGestureLayerConsumesTouch(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
   application.GetScene().Add(actor);
 
   // Add a detector
-  SignalData data;
-  GestureReceivedFunctor functor(data);
+  SignalData               data;
+  GestureReceivedFunctor   functor(data);
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
-  detector.DetectedSignal().Connect( &application, functor );
+  detector.DetectedSignal().Connect(&application, functor);
 
   // Add a layer to overlap the actor
   Layer layer = Layer::New();
-  layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
-  layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
-  application.GetScene().Add( layer );
+  layer.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f));
+  layer.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(layer);
   layer.RaiseToTop();
 
   // Render and notify
@@ -943,21 +939,21 @@ int UtcDaliLongPressGestureLayerConsumesTouch(void)
   application.Render();
 
   // Emit signals, should receive
-  TestGenerateLongPress( application, 50.0f, 50.0f );
-  TestEndLongPress( application, 50.0f, 50.0f );
+  TestGenerateLongPress(application, 50.0f, 50.0f);
+  TestEndLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
   // Set layer to consume all touch
-  layer.SetProperty( Layer::Property::CONSUMES_TOUCH, true );
+  layer.SetProperty(Layer::Property::CONSUMES_TOUCH, true);
 
   // Render and notify
   application.SendNotification();
   application.Render();
 
   // Emit the same signals again, should not receive
-  TestGenerateLongPress( application, 50.0f, 50.0f );
-  TestEndLongPress( application, 50.0f, 50.0f );
+  TestGenerateLongPress(application, 50.0f, 50.0f);
+  TestEndLongPress(application, 50.0f, 50.0f);
   DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
   data.Reset();
 
@@ -971,28 +967,117 @@ int UtcDaliLongPressGestureSetMinimumHoldingTime(void)
   const uint32_t kMinumumHolding1 = 5000;
   const uint32_t kMinumumHolding2 = 3000;
 
-  Integration::SetLongPressMinimumHoldingTime( kMinumumHolding1 );
+  Integration::SetLongPressMinimumHoldingTime(kMinumumHolding1);
 
   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 );
+  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();
 
-  SignalData data;
-  GestureReceivedFunctor functor( data );
+  SignalData             data;
+  GestureReceivedFunctor functor(data);
 
   LongPressGestureDetector detector = LongPressGestureDetector::New();
   detector.Attach(actor);
   detector.DetectedSignal().Connect(&application, functor);
 
-  DALI_TEST_EQUALS( DevelLongPressGestureDetector::GetMinimumHoldingTime( detector ), kMinumumHolding1, TEST_LOCATION );
+  DALI_TEST_EQUALS(DevelLongPressGestureDetector::GetMinimumHoldingTime(detector), kMinumumHolding1, TEST_LOCATION);
+
+  Integration::SetLongPressMinimumHoldingTime(kMinumumHolding2);
+  DALI_TEST_EQUALS(DevelLongPressGestureDetector::GetMinimumHoldingTime(detector), kMinumumHolding2, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureInterruptedWhenTouchConsumed(void)
+{
+  TestApplication application;
+
+  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);
 
-  Integration::SetLongPressMinimumHoldingTime( kMinumumHolding2 );
-  DALI_TEST_EQUALS( DevelLongPressGestureDetector::GetMinimumHoldingTime( detector ), kMinumumHolding2, TEST_LOCATION );
+  bool                           consume = false;
+  TouchEventFunctorConsumeSetter touchFunctor(consume);
+  actor.TouchedSignal().Connect(&application, touchFunctor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  SignalData             data;
+  GestureReceivedFunctor functor(data);
+
+  LongPressGestureDetector detector = LongPressGestureDetector::New();
+  detector.Attach(actor);
+  detector.DetectedSignal().Connect(&application, functor);
+
+  // Start gesture within the actor's area, we should receive the gesture as the touch is NOT being consumed
+  TestGenerateLongPress(application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+  data.Reset();
+  TestEndLongPress(application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
+  data.Reset();
+
+  // Another gesture in the same location, this time we will not receive it as touch is being consumed
+  consume = true;
+  TestGenerateLongPress(application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
+  data.Reset();
+  TestEndLongPress(application, 50.0f, 50.0f);
+  DALI_TEST_EQUALS(false, data.functorCalled, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureDisableDetectionDuringLongPressN(void)
+{
+  // Crash occurred when gesture-recognizer was deleted internally during a signal when the attached actor was detached
+
+  TestApplication application;
+
+  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);
+
+  // Add a detector
+  LongPressGestureDetector detector      = LongPressGestureDetector::New();
+  bool                     functorCalled = false;
+  detector.Attach(actor);
+  detector.DetectedSignal().Connect(
+    &application,
+    [&detector, &functorCalled](Actor actor, const LongPressGesture& gesture) {
+      if(gesture.GetState() == GestureState::FINISHED)
+      {
+        detector.Detach(actor);
+        functorCalled = true;
+      }
+    });
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Try the gesture, should not crash
+  try
+  {
+    TestGenerateLongPress(application, 50.0f, 10.0f);
+    TestEndLongPress(application, 50.0f, 10.0f);
+
+    DALI_TEST_CHECK(true); // No crash, test has passed
+    DALI_TEST_EQUALS(functorCalled, true, TEST_LOCATION);
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(false); // If we crash, the test has failed
+  }
 
   END_TEST;
 }