Replace some Dali::Actor public APIs with new properties
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ImageVisual.cpp
index 8cbab66..1549c42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 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.
@@ -59,7 +59,7 @@ std::vector<int> gReadyIds = {};
 void ResourceReadySignal( Control control )
 {
   gResourceReadySignalFired = true;
-  gReadyIds.push_back(control.GetId());
+  gReadyIds.push_back(control.GetProperty< int >( Actor::Property::ID ));
 }
 void ClearReadyIds()
 {
@@ -74,7 +74,7 @@ Actor CreateActorWithImageVisual(const Property::Map& map)
   Visual::Base visual = factory.CreateVisual( map );
   DALI_TEST_CHECK( visual );
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
   return actor;
 }
@@ -112,7 +112,7 @@ void TestVisualRender( ToolkitTestApplication& application,
     application.GetPlatform().SetClosestImageSize(  Vector2(imageDimensions.GetWidth(), imageDimensions.GetHeight()) );
   }
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -181,7 +181,7 @@ int UtcDaliImageVisualPropertyMap(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -237,7 +237,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha01(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -294,7 +294,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -340,7 +340,7 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void)
   DummyControlImpl& newDummyImpl = static_cast< DummyControlImpl& >( newActor.GetImplementation() );
   newDummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, newVisual );
 
-  newActor.SetSize( 200.f, 200.f );
+  newActor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( newActor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( newActor );
@@ -397,7 +397,7 @@ int UtcDaliImageVisualRemoteImageLoad(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -639,8 +639,8 @@ int UtcDaliImageVisualCustomWrapModePixelArea(void)
   DummyControl actor = DummyControl::New();
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
   Stage::GetCurrent().Add( actor );
 
   // loading started
@@ -717,8 +717,8 @@ int UtcDaliImageVisualCustomWrapModeNoAtlas(void)
   DummyControl actor = DummyControl::New();
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
   Stage::GetCurrent().Add( actor );
 
   // loading started
@@ -775,9 +775,9 @@ int UtcDaliImageVisualAnimateMixColor(void)
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
-  actor.SetColor(Color::BLACK);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
   Stage::GetCurrent().Add(actor);
 
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
@@ -824,7 +824,7 @@ int UtcDaliImageVisualAnimateMixColor(void)
 
   application.Render(2000u); // Halfway point between blue and white
 
-  DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>( "uColor", Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) ), true, TEST_LOCATION );
   DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>( "mixColor", Vector3( TARGET_MIX_COLOR ) ), true, TEST_LOCATION );
 
@@ -855,9 +855,9 @@ int UtcDaliImageVisualAnimateOpacity(void)
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
-  actor.SetColor(Color::BLACK);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
   Stage::GetCurrent().Add(actor);
 
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
@@ -967,9 +967,9 @@ int UtcDaliImageVisualAnimateOpacity02(void)
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
-  actor.SetColor(Color::BLACK);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
 
   tet_infoline( "Test that the opacity doesn't animate when actor not staged" );
 
@@ -1054,9 +1054,9 @@ int UtcDaliImageVisualAnimatePixelArea(void)
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
 
-  actor.SetSize(2000, 2000);
-  actor.SetParentOrigin(ParentOrigin::CENTER);
-  actor.SetColor(Color::BLACK);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(2000, 2000) );
+  actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+  actor.SetProperty( Actor::Property::COLOR,Color::BLACK);
   Stage::GetCurrent().Add(actor);
 
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
@@ -1203,7 +1203,7 @@ int UtcDaliImageVisualSetInvalidAsyncImage(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -1247,7 +1247,7 @@ int UtcDaliImageVisualSetInvalidSyncImage(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -1288,7 +1288,7 @@ int UtcDaliImageVisualSetInvalidRemoteImage(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -1339,7 +1339,7 @@ int UtcDaliImageVisualAlphaMask(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
 
@@ -1362,6 +1362,59 @@ int UtcDaliImageVisualAlphaMask(void)
   END_TEST;
 }
 
+int UtcDaliImageVisualSynchronousLoadAlphaMask(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Request image visual with a Property::Map containing an Alpha mask with synchronous loading" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  Property::Map propertyMap;
+  propertyMap.Insert( Toolkit::Visual::Property::TYPE,  Visual::IMAGE );
+  propertyMap.Insert( ImageVisual::Property::URL,  TEST_LARGE_IMAGE_FILE_NAME );
+  propertyMap.Insert( ImageVisual::Property::ALPHA_MASK_URL, TEST_MASK_IMAGE_FILE_NAME );
+  propertyMap.Insert( ImageVisual::Property::SYNCHRONOUS_LOADING, true );
+
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  Property::Map testMap;
+  visual.CreatePropertyMap(testMap);
+  DALI_TEST_EQUALS(*testMap.Find(ImageVisual::Property::ALPHA_MASK_URL),Property::Value(TEST_MASK_IMAGE_FILE_NAME), TEST_LOCATION );
+
+  // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
+  // Image with a size smaller than 512*512 will be uploaded as a part of the atlas.
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
+  DummyControl actor = DummyControl::New();
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
+  dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
+
+  Stage::GetCurrent().Add( actor );
+
+  // Do not wait for any EventThreadTrigger in synchronous alpha mask.
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.IsResourceReady(), true, TEST_LOCATION );
+
+  dummyImpl.UnregisterVisual(  Control::CONTROL_PROPERTY_END_INDEX + 1 );
+  DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliImageVisualRemoteAlphaMask(void)
 {
   ToolkitTestApplication application;
@@ -1375,13 +1428,14 @@ int UtcDaliImageVisualRemoteAlphaMask(void)
   Property::Map propertyMap;
   propertyMap.Insert( Toolkit::Visual::Property::TYPE,  Visual::IMAGE );
   propertyMap.Insert( ImageVisual::Property::URL,  TEST_IMAGE_FILE_NAME );
-  propertyMap.Insert( "alphaMaskUrl", MASK_IMAGE );
+  propertyMap.Insert( ImageVisual::Property::ALPHA_MASK_URL, MASK_IMAGE );
 
   Visual::Base visual = factory.CreateVisual( propertyMap );
   DALI_TEST_CHECK( visual );
 
   Property::Map testMap;
   visual.CreatePropertyMap(testMap);
+
   DALI_TEST_EQUALS(*testMap.Find(ImageVisual::Property::ALPHA_MASK_URL),Property::Value(MASK_IMAGE), TEST_LOCATION );
 
   // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
@@ -1394,9 +1448,10 @@ int UtcDaliImageVisualRemoteAlphaMask(void)
   DummyControl actor = DummyControl::New();
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
+
   DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
 
   Stage::GetCurrent().Add( actor );
@@ -1415,7 +1470,6 @@ int UtcDaliImageVisualRemoteAlphaMask(void)
   END_TEST;
 }
 
-
 int UtcDaliImageVisualAlphaMaskCrop(void)
 {
   ToolkitTestApplication application;
@@ -1451,7 +1505,7 @@ int UtcDaliImageVisualAlphaMaskCrop(void)
   DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>(actor.GetImplementation());
   dummyImpl.RegisterVisual( Control::CONTROL_PROPERTY_END_INDEX + 1, visual );
 
-  actor.SetSize( 200.f, 200.f );
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
   DALI_TEST_EQUALS( actor.GetRendererCount(), 0u, TEST_LOCATION );
   DALI_TEST_EQUALS( actor.IsResourceReady(), false, TEST_LOCATION );
 
@@ -1494,7 +1548,7 @@ int UtcDaliImageVisualReleasePolicy01(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset();
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   application.SendNotification();
   application.Render(0);
@@ -1544,7 +1598,7 @@ int UtcDaliImageVisualReleasePolicy02(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   application.SendNotification();
   application.Render(0);
@@ -1595,7 +1649,7 @@ int UtcDaliImageVisualReleasePolicy03(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   application.SendNotification();
   application.Render(0);
@@ -1650,7 +1704,7 @@ int UtcDaliImageVisualReleasePolicy04(void)
   imageVisualNever.Reset(); // reduce ref count so only the control keeps the visual alive.
   imageVisualDestroyed.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   // Test initially zero renderers
   application.SendNotification();
@@ -1734,7 +1788,7 @@ int UtcDaliImageVisualReleasePolicy06(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   application.SendNotification();
   application.Render(0);
@@ -1800,7 +1854,7 @@ int UtcDaliImageVisualReleasePolicy07(void)
   imageVisualDestroyed.Reset(); // reduce ref count so only the control keeps the visual alive.
   imageVisualDetached.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   // Test initially zero renderers
   application.SendNotification();
@@ -1883,7 +1937,7 @@ int UtcDaliImageVisualLoadPolicy01(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   Stage::GetCurrent().Add( actor );
   tet_infoline( "Ensure nothing triggers another load as texure already loaded" );
   const unsigned int TIME_OUT_3_SECONDS = 3;
@@ -1937,7 +1991,7 @@ int UtcDaliImageVisualLoadPolicy02(void)
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual );
   imageVisual.Reset(); // reduce ref count so only the control keeps the visual alive.
 
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   Stage::GetCurrent().Add( actor );
   tet_infoline( "Allow image time to load" );
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
@@ -1977,7 +2031,7 @@ int UtcDaliImageVisualLoadPolicy03(void)
   DummyControl actor = DummyControl::New(true);
   actor.ResourceReadySignal().Connect( &ResourceReadySignal);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   tet_infoline( "Create visual with IMMEDIATE load policy" );
   Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
@@ -2015,7 +2069,7 @@ int UtcDaliImageVisualLoadPolicy04(void)
   DummyControl actor = DummyControl::New(true);
   actor.ResourceReadySignal().Connect( &ResourceReadySignal);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
 
   tet_infoline( "Create visual with IMMEDIATE load policy" );
   Visual::Base imageVisual = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
@@ -2044,7 +2098,7 @@ int UtcDaliImageVisualLoadPolicy04(void)
   tet_infoline( "Registering visual this should trigger the loading signal as is already image loaded for previous control" );
   dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 );
   imageVisual2.Reset(); // reduce ref count so only the control keeps the visual alive.
-  actor2.SetSize(200.f, 200.f);
+  actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 0 ), true, TEST_LOCATION ); // Not expecting any further loading as texture is being reused.
   DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
 
@@ -2065,7 +2119,7 @@ int UtcDaliImageVisualLoadPolicy05(void)
   DummyControl actor = DummyControl::New(true);
   actor.ResourceReadySignal().Connect( &ResourceReadySignal);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   Stage::GetCurrent().Add( actor );
 
   tet_infoline( "Create visual with ATTACHED load policy" );
@@ -2095,7 +2149,7 @@ int UtcDaliImageVisualLoadPolicy05(void)
   tet_infoline( "Registering visual this should trigger the loading signal as is already image loaded for previous control" );
   dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 );
   imageVisual2.Reset(); // reduce ref count so only the control keeps the visual alive.
-  actor2.SetSize(200.f, 200.f);
+  actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 0 ), true, TEST_LOCATION ); // Not expecting any further loading as texture is being reused.
   DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
 
@@ -2185,8 +2239,8 @@ int UtcDaliImageVisualCustomShader(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 );
+  dummy.SetProperty( Actor::Property::SIZE, Vector2( 200.f, 200.f ) );
+  dummy.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   Stage::GetCurrent().Add( dummy );
 
   application.SendNotification();
@@ -2217,8 +2271,8 @@ int UtcDaliImageVisualCustomShader(void)
   DummyControl dummy1 = DummyControl::New( true );
   Impl::DummyControl& dummyImpl1 = static_cast< Impl::DummyControl& >( dummy1.GetImplementation() );
   dummyImpl1.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual1 );
-  dummy1.SetSize( 200, 200 );
-  dummy1.SetParentOrigin( ParentOrigin::CENTER );
+  dummy1.SetProperty( Actor::Property::SIZE, Vector2( 200, 200 ) );
+  dummy1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   Stage::GetCurrent().Add( dummy1 );
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2241,7 +2295,7 @@ void ResourceReadyLoadNext( Control control )
   static int callNumber = 0;
 
   gResourceReadySignalFired = true;
-  gReadyIds.push_back(control.GetId());
+  gReadyIds.push_back(control.GetProperty< int >( Actor::Property::ID ));
 
   if( callNumber == 0 )
   {
@@ -2274,10 +2328,10 @@ int UtcDaliImageVisualLoadReady01(void)
 
   tet_infoline( "Create a control and connect to resource ready signal" );
   DummyControl actor = DummyControl::New(true);
-  int actor1Id = actor.GetId();
+  int actor1Id = actor.GetProperty< int >( Actor::Property::ID );
   actor.ResourceReadySignal().Connect( &ResourceReadySignal);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
-  actor.SetSize(200.f, 200.f);
+  actor.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   Stage::GetCurrent().Add(actor);
 
   tet_infoline( "Create visual with IMMEDIATE load policy" );
@@ -2305,14 +2359,14 @@ int UtcDaliImageVisualLoadReady01(void)
   Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_BROKEN_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
 
   DummyControl actor2 = DummyControl::New(true);
-  int actor2Id = actor2.GetId();
+  int actor2Id = actor2.GetProperty< int >( Actor::Property::ID );
   Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(actor2.GetImplementation());
   actor2.ResourceReadySignal().Connect( &ResourceReadyLoadNext);
 
   tet_infoline( "Registering visual this should trigger the ready signal when the image fails to load" );
   dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 );
 
-  actor2.SetSize(200.f, 200.f);
+  actor2.SetProperty( Actor::Property::SIZE, Vector2(200.f, 200.f) );
   Stage::GetCurrent().Add(actor2);
 
   tet_infoline( "Wait for loading thread to finish");