Change RenderTaskList to behave like any other SceneGraph object
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TapGestureDetector.cpp
index 8efcad1..25b8e89 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/tap-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>
 
@@ -151,7 +152,7 @@ int UtcDaliTapGestureDetectorCopyConstructorP(void)
 {
   TestApplication application;
 
-  TapGestureDetector detector = TapGestureDetector::New();;
+  TapGestureDetector detector = TapGestureDetector::New();
 
   TapGestureDetector copy( detector );
   DALI_TEST_CHECK( detector );
@@ -164,10 +165,11 @@ int UtcDaliTapGestureDetectorAssignmentOperatorP(void)
 
   TapGestureDetector detector = TapGestureDetector::New();;
 
-  TapGestureDetector copy = detector;
+  TapGestureDetector assign;
+  assign = detector;
   DALI_TEST_CHECK( detector );
 
-  DALI_TEST_CHECK( detector == copy );
+  DALI_TEST_CHECK( detector == assign );
   END_TEST;
 }
 
@@ -207,7 +209,10 @@ int UtcDaliTapGestureDetectorNew(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);
 
@@ -962,7 +967,7 @@ int UtcDaliTapGestureEmitIncorrectStateClear(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -995,7 +1000,7 @@ int UtcDaliTapGestureEmitIncorrectStateContinuing(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1028,7 +1033,7 @@ int UtcDaliTapGestureEmitIncorrectStateFinished(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "false", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Incorrect state", TEST_LOCATION );
   }
   END_TEST;
 }
@@ -1197,7 +1202,12 @@ int UtcDaliTapGestureSystemOverlay(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);
@@ -1229,7 +1239,12 @@ int UtcDaliTapGestureBehindTouchableSystemOverlay(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();
@@ -1272,7 +1287,7 @@ int UtcDaliTapGestureBehindTouchableSystemOverlay(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 );
 
@@ -1284,7 +1299,12 @@ int UtcDaliTapGestureTouchBehindGesturedSystemOverlay(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();
@@ -1327,7 +1347,7 @@ int UtcDaliTapGestureTouchBehindGesturedSystemOverlay(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 );