Change RenderTaskList to behave like any other SceneGraph object
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-LongPressGestureDetector.cpp
index d9fdd27..908cb9b 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
 #include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-utils.h>
 
@@ -147,7 +148,7 @@ Integration::LongPressGestureEvent GenerateLongPress(
 
 
 // Positive test case for a method
-int UtcDaliLongPressGestureDetectorConstructor(void)
+int UtcDaliLongPressGestureDetectorConstructorP(void)
 {
   TestApplication application;
 
@@ -156,6 +157,31 @@ int UtcDaliLongPressGestureDetectorConstructor(void)
   END_TEST;
 }
 
+int UtcDaliLongPressGestureDetectorCopyConstructorP(void)
+{
+  TestApplication application;
+
+  LongPressGestureDetector detector = LongPressGestureDetector::New();;
+
+  LongPressGestureDetector copy( detector );
+  DALI_TEST_CHECK( detector );
+  END_TEST;
+}
+
+int UtcDaliLongPressGestureDetectorAssignmentOperatorP(void)
+{
+  TestApplication application;
+
+  LongPressGestureDetector detector;
+  detector = LongPressGestureDetector::New();;
+
+  LongPressGestureDetector copy;
+  copy = detector;
+  DALI_TEST_CHECK( detector );
+
+  DALI_TEST_CHECK( detector == copy );
+  END_TEST;
+}
 
 int UtcDaliLongPressGestureDetectorNew(void)
 {
@@ -198,7 +224,10 @@ int UtcDaliLongPressGestureDetectorNew(void)
   actor.TouchedSignal().Connect(&application, touchFunctor);
 
   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);
 
@@ -944,7 +973,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateClear(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -977,7 +1006,7 @@ int UtcDaliLongPressGestureEmitIncorrectStateContinuing(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1241,7 +1270,12 @@ int UtcDaliLongPressGestureSystemOverlay(void)
   TestApplication application;
   Dali::Integration::Core& core = application.GetCore();
   Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
+
+  Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+  Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
+  Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
+  Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+  systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
 
   Actor actor = Actor::New();
   actor.SetSize(100.0f, 100.0f);
@@ -1272,7 +1306,12 @@ int UtcDaliLongPressGestureBehindTouchableSystemOverlay(void)
   TestApplication application;
   Dali::Integration::Core& core = application.GetCore();
   Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
+
+  Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+  Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
+  Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
+  Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+  systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
 
   // SystemOverlay actor
   Actor systemOverlayActor = Actor::New();
@@ -1314,7 +1353,7 @@ int UtcDaliLongPressGestureBehindTouchableSystemOverlay(void)
   touchData.Reset();
 
   // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoords ) );
+  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
   DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
 
@@ -1326,7 +1365,12 @@ int UtcDaliLongPressGestureTouchBehindGesturedSystemOverlay(void)
   TestApplication application;
   Dali::Integration::Core& core = application.GetCore();
   Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
+
+  Dali::RenderTaskList overlayRenderTaskList = Integration::RenderTaskList::New();
+  Dali::Actor overlayRootActor = systemOverlay.GetDefaultRootActor();
+  Dali::CameraActor overlayCameraActor = systemOverlay.GetDefaultCameraActor();
+  Integration::RenderTaskList::CreateTask( overlayRenderTaskList, overlayRootActor, overlayCameraActor );
+  systemOverlay.SetOverlayRenderTasks( overlayRenderTaskList );
 
   // SystemOverlay actor
   Actor systemOverlayActor = Actor::New();
@@ -1368,7 +1412,7 @@ int UtcDaliLongPressGestureTouchBehindGesturedSystemOverlay(void)
   touchData.Reset();
 
   // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( TouchPoint::Down, screenCoords ) );
+  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
   DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
   DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );