Merge remote-tracking branch 'origin/tizen' into devel/new_mesh
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-RenderTask.cpp
index 7b22063..792ade5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/events/hit-test-algorithm.h>
 #include <dali-test-suite-utils.h>
 #include <dali/integration-api/debug.h>
 #include <test-native-image.h>
@@ -1392,7 +1393,7 @@ int UtcDaliRenderTaskSetViewportPosition(void)
 
   Vector2 newPosition3(64.0f, 0.0f);
   Animation animation = Animation::New(1.0f);
-  animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunctions::Linear );
+  animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_POSITION ), newPosition3, AlphaFunction::LINEAR );
   animation.Play();
 
   // Perform 1000ms worth of updates at which point animation should have completed.
@@ -1440,7 +1441,7 @@ int UtcDaliRenderTaskSetViewportSize(void)
 
   Vector2 newSize3(10.0f, 10.0f);
   Animation animation = Animation::New(1.0f);
-  animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunctions::Linear );
+  animation.AnimateTo( Property( task, RenderTask::Property::VIEWPORT_SIZE ), newSize3, AlphaFunction::LINEAR );
   animation.Play();
 
   // Perform 1000ms worth of updates at which point animation should have completed.
@@ -2961,8 +2962,8 @@ int UtcDaliRenderTaskProperties(void)
 
   Property::IndexContainer indices;
   task.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), task.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), task.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -3121,3 +3122,44 @@ int UtcDaliRenderTaskFinishInvisibleSourceActor(void)
 
   END_TEST;
 }
+
+int UtcDaliRenderTaskFinishMissingImage(void)
+{
+  TestApplication application;
+
+  // Previously we had bugs where not having a resource ID would cause render-tasks to wait forever
+  tet_infoline("Testing RenderTask::SignalFinished() when an ImageActor has no Image set");
+
+  Stage stage = Stage::GetCurrent();
+
+  BufferImage image = BufferImage::New( 10, 10 );
+  ImageActor rootActor = ImageActor::New( image );
+  rootActor.SetSize( 10, 10 );
+  stage.Add( rootActor );
+
+  ImageActor actorWithMissingImage = ImageActor::New( Image() );
+  actorWithMissingImage.SetSize( 10, 10 );
+  stage.Add( actorWithMissingImage );
+
+  RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+  RenderTask newTask = taskList.CreateTask();
+  newTask.SetInputEnabled( false );
+  newTask.SetClearColor( Vector4( 0.f, 0.f, 0.f, 0.f ) );
+  newTask.SetClearEnabled( true );
+  newTask.SetExclusive( true );
+  newTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+
+  bool finished = false;
+  RenderTaskFinished renderTaskFinished( finished );
+  newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+
+  // 1 render to process render task, then 1 before finished msg is sent from update to the event thread.
+  application.SendNotification();
+  application.Render();
+  application.Render();
+
+  application.SendNotification();
+  DALI_TEST_CHECK( finished );
+
+  END_TEST;
+}