Add AnimatedVectorImageVisual property
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-AnimatedVectorImageVisual.cpp
index 096b960..534aeb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-timer.h>
 #include <toolkit-event-thread-callback.h>
+#include <toolkit-vector-animation-renderer.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
@@ -29,6 +30,7 @@
 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h>
 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include "dummy-control.h"
 
 using namespace Dali;
@@ -73,8 +75,8 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void)
   DummyControl actor = DummyControl::New( true );
   DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -84,7 +86,7 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void)
   Renderer renderer = actor.GetRendererAt( 0u );
   DALI_TEST_CHECK( renderer );
 
-  // Test SetOffStage().
+  // Test SetOffScene().
   actor.Unparent();
   DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
 
@@ -106,8 +108,8 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual02(void)
   DummyControl actor = DummyControl::New( true );
   DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -145,8 +147,8 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual03(void)
   DummyControl actor = DummyControl::New( true );
   DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -178,7 +180,8 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
              .Add( "loopCount", 3 )
              .Add( "playRange", playRange )
              .Add( "stopBehavior", DevelImageVisual::StopBehavior::FIRST_FRAME )
-             .Add( "loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE );
+             .Add( "loopingMode", DevelImageVisual::LoopingMode::AUTO_REVERSE )
+             .Add( "redrawInScalingDown", false );
 
   Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
   DALI_TEST_CHECK( visual );
@@ -186,14 +189,18 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
   DummyControl actor = DummyControl::New( true );
   DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
-  actor.SetSize( 200.0f, 200.0f );
-  Stage::GetCurrent().Add( actor );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
 
+  // Trigger count is 1 - render a frame
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
   // renderer is added to actor
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+
   Renderer renderer = actor.GetRendererAt( 0u );
   DALI_TEST_CHECK( renderer );
 
@@ -226,6 +233,10 @@ int UtcDaliVisualFactoryGetAnimatedVectorImageVisual04(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::LoopingMode::AUTO_REVERSE );
 
+  value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< bool >() == false );
+
   actor.Unparent( );
   DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
 
@@ -257,13 +268,15 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   Property::Map resultMap;
   resultMap = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
 
@@ -300,6 +313,10 @@ int UtcDaliAnimatedVectorImageVisualGetPropertyMap01(void)
   value = resultMap.Find( DevelImageVisual::Property::CONTENT_INFO, Property::MAP );
   DALI_TEST_CHECK( value );
 
+  value = resultMap.Find( DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, Property::BOOLEAN );
+  DALI_TEST_CHECK( value );
+  DALI_TEST_CHECK( value->Get< bool >() == true );    // Check default value
+
   // request AnimatedVectorImageVisual with an URL
   Visual::Base visual2 = factory.CreateVisual( TEST_VECTOR_IMAGE_FILE_NAME, ImageDimensions() );
 
@@ -341,12 +358,10 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     tet_infoline( "Test Play action" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
 
-    Stage::GetCurrent().Add( dummyControl );
+    application.GetScene().Add( dummyControl );
     application.SendNotification();
     application.Render( 16 );
 
-    std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );    // wait for one animation loop (16fps, 5frames, need 80ms)
-
     Property::Map map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
     Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
     DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PLAYING );
@@ -357,8 +372,6 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     application.SendNotification();
     application.Render(16);
 
-    std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
-
     map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
     value = map.Find( DevelImageVisual::Property::PLAY_STATE );
     DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED );
@@ -411,17 +424,17 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
 
     map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
     value = map.Find( DevelImageVisual::Property::PLAY_STATE );
-    DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED );
+    DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
 
     tet_infoline( "On stage again" );
-    Stage::GetCurrent().Add( dummyControl );
+    application.GetScene().Add( dummyControl );
 
     application.SendNotification();
     application.Render(16);
 
     map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
     value = map.Find( DevelImageVisual::Property::PLAY_STATE );
-    DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::PAUSED );
+    DALI_TEST_CHECK( value->Get< int >() == DevelImageVisual::PlayState::STOPPED );
 
     tet_infoline( "Test Play action" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -435,7 +448,7 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
 
     // Change Size
     Vector3 newSize( 100.0f, 100.0f, 0.0f );
-    dummyControl.SetSize( newSize );
+    dummyControl.SetProperty( Actor::Property::SIZE, newSize );
 
     application.SendNotification();
     application.Render(16);
@@ -474,9 +487,9 @@ int UtcDaliAnimatedVectorImageVisualCustomShader(void)
   Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummy.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  dummy.SetSize( 200.f, 200.f );
-  dummy.SetParentOrigin( ParentOrigin::CENTER );
-  Stage::GetCurrent().Add( dummy );
+  dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+  dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  application.GetScene().Add( dummy );
 
   application.SendNotification();
   application.Render();
@@ -515,7 +528,7 @@ int UtcDaliAnimatedVectorImageVisualNaturalSize(void)
   Vector2 controlSize( 20.f, 30.f );
   Vector2 naturalSize;
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -524,7 +537,7 @@ int UtcDaliAnimatedVectorImageVisualNaturalSize(void)
 
   DALI_TEST_EQUALS( naturalSize, Vector2( 100.0f, 100.0f ), TEST_LOCATION );    // 100x100 is the content default size.
 
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
   application.SendNotification();
   application.Render();
@@ -554,9 +567,9 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -564,7 +577,7 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void)
   application.SendNotification();
   application.Render();
 
-  // Trigger count is 1 - animation finished
+  // Trigger count is 1 - render a frame
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
   // renderer is added to actor
@@ -598,9 +611,9 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -608,6 +621,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   // renderer is added to actor
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
   Renderer renderer = actor.GetRendererAt( 0u );
@@ -636,6 +651,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
 
@@ -656,6 +673,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
   DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
@@ -671,6 +690,8 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
 
@@ -687,6 +708,106 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
   END_TEST;
 }
 
+int UtcDaliAnimatedVectorImageVisualPlayRangeMarker(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimatedVectorImageVisualPlayRangeMarker" );
+
+  Property::Array array;
+  array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
+             .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME  )
+             .Add( DevelImageVisual::Property::PLAY_RANGE, array  );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  Vector2 controlSize( 20.f, 30.f );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
+
+  application.GetScene().Add( actor );
+
+  Property::Map attributes;
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
+  // renderer is added to actor
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+  Renderer renderer = actor.GetRendererAt( 0u );
+  DALI_TEST_CHECK( renderer );
+
+  Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+
+  int resultStartFrame, resultEndFrame;
+  Property::Array* result = value->GetArray();
+  result->GetElementAt( 0 ).Get( resultStartFrame );
+  result->GetElementAt( 1 ).Get( resultEndFrame );
+
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION );
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_1, resultEndFrame, TEST_LOCATION );
+
+  // Set 2 markers
+  array.Clear();
+  array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
+  array.PushBack( VECTOR_ANIMATION_MARKER_NAME_2 );
+
+  attributes.Clear();
+  attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::UPDATE_PROPERTY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
+  map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+
+  result = value->GetArray();
+  result->GetElementAt( 0 ).Get( resultStartFrame );
+  result->GetElementAt( 1 ).Get( resultEndFrame );
+
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION );
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION );
+
+  // Set invalid play range
+  array.Clear();
+  array.PushBack( 1 );
+  array.PushBack( VECTOR_ANIMATION_MARKER_NAME_1 );
+
+  attributes.Clear();
+  attributes.Add( DevelImageVisual::Property::PLAY_RANGE, array );
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::UPDATE_PROPERTY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
+  map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
+
+  result = value->GetArray();
+  result->GetElementAt( 0 ).Get( resultStartFrame );
+  result->GetElementAt( 1 ).Get( resultEndFrame );
+
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_START_FRAME_1, resultStartFrame, TEST_LOCATION );  // Should not be changed
+  DALI_TEST_EQUALS( VECTOR_ANIMATION_MARKER_END_FRAME_2, resultEndFrame, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
 {
   ToolkitTestApplication application;
@@ -707,9 +828,9 @@ int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
   DevelControl::VisualEventSignal( actor ).Connect( &VisualEventSignal );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -718,7 +839,7 @@ int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
   application.Render();
 
   // Wait for animation finish
-  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
 
   Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
@@ -741,14 +862,16 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
   DALI_TEST_CHECK( visual );
 
+  tet_printf( "1. Visual is created.\n" );
+
   DummyControl actor = DummyControl::New( true );
   DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -758,10 +881,14 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
   DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
 
+  tet_printf( "2. The current frame number is [%d].\n", value->Get< int >() );
+
   Property::Array array;
   array.PushBack( 0 );
   array.PushBack( 2 );
@@ -775,10 +902,14 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
   DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
 
+  tet_printf( "3. The current frame number is [%d].\n", value->Get< int >() );
+
   // Change play range
   attributes.Clear();
   array.Clear();
@@ -803,27 +934,35 @@ int UtcDaliAnimatedVectorImageVisualJumpTo(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
   DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
 
+  tet_printf( "4. The current frame number is [%d].\n", value->Get< int >() );
+
   // Jump to the same position
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::JUMP_TO, 3 );
 
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
   DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
 
+  tet_printf( "5. The current frame number is [%d].\n", value->Get< int >() );
+
   END_TEST;
 }
 
 int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliAnimatedVectorImageVisualJumpToCurrentProgress" );
+  tet_infoline( "UtcDaliAnimatedVectorImageVisualUpdateProperty" );
 
   int startFrame = 1, endFrame = 3;
   Property::Array playRange;
@@ -844,13 +983,15 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   Property::Value* value = map.Find( DevelImageVisual::Property::LOOP_COUNT );
   DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
@@ -877,6 +1018,8 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::LOOP_COUNT );
   DALI_TEST_EQUALS( value->Get< int >(), 5, TEST_LOCATION );
@@ -901,6 +1044,8 @@ int UtcDaliAnimatedVectorImageVisualUpdateProperty(void)
   application.SendNotification();
   application.Render();
 
+  std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) );    // wait for next rasterize thread run
+
   map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   value = map.Find( DevelImageVisual::Property::PLAY_RANGE );
 
@@ -950,9 +1095,9 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -961,7 +1106,7 @@ int UtcDaliAnimatedVectorImageVisualStopBehavior(void)
   application.Render();
 
   // Trigger count is 1 - animation finished
-  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
 
   Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
@@ -1045,9 +1190,9 @@ int UtcDaliAnimatedVectorImageVisualLoopingMode(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -1056,7 +1201,7 @@ int UtcDaliAnimatedVectorImageVisualLoopingMode(void)
   application.Render();
 
   // Trigger count is 1 - animation finished
-  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
 
   Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
   Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
@@ -1122,10 +1267,10 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
 
   Vector2 controlSize( 20.f, 30.f );
   Vector3 controlScale( 2.0f, 2.0f, 1.0f );
-  actor.SetSize( controlSize );
-  actor.SetScale( controlScale );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
+  actor.SetProperty( Actor::Property::SCALE, controlScale );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -1145,8 +1290,8 @@ int UtcDaliAnimatedVectorImageVisualPropertyNotification(void)
   // Change scale and size
   controlSize = Vector2( 50.f, 40.f );
   controlScale= Vector3( 0.5f, 0.5f, 1.0f );
-  actor.SetSize( controlSize );
-  actor.SetScale( controlScale );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
+  actor.SetProperty( Actor::Property::SCALE, controlScale );
 
   application.SendNotification();
   application.Render();
@@ -1183,9 +1328,9 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void)
   dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual1 );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor1.SetSize( controlSize );
+  actor1.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor1 );
+  application.GetScene().Add( actor1 );
 
   propertyMap.Clear();
   propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
@@ -1198,9 +1343,9 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void)
   DummyControlImpl& dummyImpl2 = static_cast< DummyControlImpl& >( actor2.GetImplementation() );
   dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual2 );
 
-  actor2.SetSize( controlSize );
+  actor2.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor2 );
+  application.GetScene().Add( actor2 );
 
   DevelControl::DoAction( actor2, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, Property::Map() );
 
@@ -1230,10 +1375,57 @@ int UtcDaliAnimatedVectorImageVisualMultipleInstances(void)
   END_TEST;
 }
 
-int UtcDaliAnimatedVectorImageVisualVisibilityChanged(void)
+int UtcDaliAnimatedVectorImageVisualControlVisibilityChanged(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimatedVectorImageVisualControlVisibilityChanged" );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
+             .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  Vector2 controlSize( 20.f, 30.f );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
+
+  application.GetScene().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map attributes;
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  // Check rendering behavior
+  DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+  Renderer renderer = actor.GetRendererAt( 0u );
+  DALI_TEST_CHECK( renderer );
+  DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::CONTINUOUSLY );
+
+  actor.SetProperty( Actor::Property::VISIBLE, false );
+
+  application.SendNotification();
+  application.Render();
+
+  // Check rendering behavior again
+  DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::IF_REQUIRED );
+
+  END_TEST;
+}
+
+int UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliAnimatedVectorImageVisualVisibilityChanged" );
+  tet_infoline( "UtcDaliAnimatedVectorImageVisualWindowVisibilityChanged" );
 
   Property::Map propertyMap;
   propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
@@ -1247,9 +1439,9 @@ int UtcDaliAnimatedVectorImageVisualVisibilityChanged(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
   Vector2 controlSize( 20.f, 30.f );
-  actor.SetSize( controlSize );
+  actor.SetProperty( Actor::Property::SIZE, controlSize );
 
-  Stage::GetCurrent().Add( actor );
+  application.GetScene().Add( actor );
 
   application.SendNotification();
   application.Render();
@@ -1257,13 +1449,17 @@ int UtcDaliAnimatedVectorImageVisualVisibilityChanged(void)
   Property::Map attributes;
   DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
 
+  application.SendNotification();
+  application.Render();
+
   // Check rendering behavior
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
   Renderer renderer = actor.GetRendererAt( 0u );
   DALI_TEST_CHECK( renderer );
   DALI_TEST_CHECK( renderer.GetProperty< int >( DevelRenderer::Property::RENDERING_BEHAVIOR ) == DevelRenderer::Rendering::CONTINUOUSLY );
 
-  actor.SetVisible( false );
+  Window window = DevelWindow::Get( actor );
+  window.Hide();
 
   application.SendNotification();
   application.Render();