Add KEYBOARD_FOCUSABLE_CHILDREN property.
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Actor.cpp
index cfd98de..8da28bc 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/public-api/dali-core.h>
 #include <mesh-builder.h>
+#include <test-actor-utils.h>
 
 #include <cfloat> // For FLT_MAX
 #include <string>
@@ -59,17 +60,6 @@ static bool gTestConstraintCalled;
 
 LayoutDirection::Type gLayoutDirectionType;
 
-Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height)
-{
-  Texture texture = Texture::New(type, format, width, height);
-
-  int       bufferSize = width * height * 2;
-  uint8_t*  buffer     = reinterpret_cast<uint8_t*>(malloc(bufferSize));
-  PixelData pixelData  = PixelData::New(buffer, bufferSize, width, height, format, PixelData::FREE);
-  texture.Upload(pixelData, 0u, 0u, 0u, 0u, width, height);
-  return texture;
-}
-
 struct TestConstraint
 {
   void operator()(Vector4& color, const PropertyInputContainer& /* inputs */)
@@ -647,6 +637,32 @@ int UtcDaliActorRemoveP(void)
   END_TEST;
 }
 
+int UtcDaliActorSwitchParentN(void)
+{
+  tet_infoline("Testing Actor::UtcDaliActorSwitchParentN");
+  TestApplication application;
+
+  Actor parent1 = Actor::New();
+  Actor child   = Actor::New();
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION);
+
+  parent1.Add(child);
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION);
+
+  Actor parent2 = Actor::New();
+
+  DALI_TEST_EQUALS(parent2.GetChildCount(), 0u, TEST_LOCATION);
+
+  // Try switch parent with that both of parent1 and parent2 are off scene.
+  DevelActor::SwitchParent(child, parent2);
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(parent2.GetChildCount(), 0u, TEST_LOCATION);
+  END_TEST;
+}
+
 int UtcDaliActorGetChildCount(void)
 {
   TestApplication application;
@@ -2534,6 +2550,54 @@ int UtcDaliActorIsKeyboardFocusable(void)
   END_TEST;
 }
 
+int UtcDaliActorSetKeyboardFocusableChildren(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  actor.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, true);
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == true);
+
+  actor.SetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN, false);
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == false);
+  END_TEST;
+}
+
+int UtcDaliActorAreChildrenKeyBoardFocusable(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN) == true);
+  END_TEST;
+}
+
+int UtcDaliActorSetTouchFocusable(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  actor.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true);
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::TOUCH_FOCUSABLE) == true);
+
+  actor.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, false);
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::TOUCH_FOCUSABLE) == false);
+  END_TEST;
+}
+
+int UtcDaliActorIsTouchFocusable(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  DALI_TEST_CHECK(actor.GetProperty<bool>(DevelActor::Property::TOUCH_FOCUSABLE) == false);
+  END_TEST;
+}
+
 int UtcDaliActorRemoveConstraints(void)
 {
   tet_infoline(" UtcDaliActorRemoveConstraints");
@@ -4153,7 +4217,9 @@ void CheckColorMask(TestGlAbstraction& glAbstraction, bool maskValue)
   DALI_TEST_EQUALS<bool>(colorMaskParams.red, maskValue, TEST_LOCATION);
   DALI_TEST_EQUALS<bool>(colorMaskParams.green, maskValue, TEST_LOCATION);
   DALI_TEST_EQUALS<bool>(colorMaskParams.blue, maskValue, TEST_LOCATION);
-  DALI_TEST_EQUALS<bool>(colorMaskParams.alpha, maskValue, TEST_LOCATION);
+
+  // @todo only test alpha if the framebuffer has an alpha channel
+  //DALI_TEST_EQUALS<bool>(colorMaskParams.alpha, maskValue, TEST_LOCATION);
 }
 
 int UtcDaliActorPropertyClippingP(void)
@@ -4507,7 +4573,7 @@ int UtcDaliActorPropertyClippingActorDrawOrder(void)
   END_TEST;
 }
 
-int UtcDaliActorPropertyScissorClippingActor(void)
+int UtcDaliActorPropertyScissorClippingActor01(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor");
@@ -4561,6 +4627,68 @@ int UtcDaliActorPropertyScissorClippingActor(void)
   END_TEST;
 }
 
+int UtcDaliActorPropertyScissorClippingActor02(void)
+{
+  // This test checks that an actor is correctly setup for clipping.
+  tet_infoline("Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor with a transparent renderer");
+  TestApplication application;
+
+  TestGlAbstraction& glAbstraction       = application.GetGlAbstraction();
+  TraceCallStack&    scissorTrace        = glAbstraction.GetScissorTrace();
+  TraceCallStack&    enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
+
+  const Vector2 stageSize(TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT);
+  const Vector2 actorSize(16.0f, 16.0f);
+
+  // Create a clipping actor.
+  Actor clippingActorA                  = CreateRenderableActor();
+  clippingActorA[Actor::Property::SIZE] = actorSize;
+
+  Renderer renderer = clippingActorA.GetRendererAt(0);
+  DALI_TEST_CHECK(renderer);
+
+  // Make Renderer opacity 0.
+  renderer[DevelRenderer::Property::OPACITY] = 0.0f;
+
+  // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system.
+  // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test.
+  clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT);
+  clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT);
+  clippingActorA.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX);
+  application.GetScene().Add(clippingActorA);
+
+  // Gather the call trace.
+  GenerateTrace(application, enabledDisableTrace, scissorTrace);
+
+  // Check we are writing to the color buffer.
+  CheckColorMask(glAbstraction, true);
+
+  // Check scissor test was enabled.
+
+  std::ostringstream scissor;
+  scissor << std::hex << GL_SCISSOR_TEST;
+  DALI_TEST_CHECK(enabledDisableTrace.FindMethodAndParams("Enable", scissor.str()));
+
+  // Check the scissor was set, and the coordinates are correct.
+  std::stringstream compareParametersString;
+  compareParametersString << "0, 0, " << actorSize.x << ", " << actorSize.y;
+  DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 0, 0, 16, 16
+
+  clippingActorA.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT);
+  clippingActorA.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT);
+
+  // Gather the call trace.
+  GenerateTrace(application, enabledDisableTrace, scissorTrace);
+
+  // Check the scissor was set, and the coordinates are correct.
+  compareParametersString.str(std::string());
+  compareParametersString.clear();
+  compareParametersString << (stageSize.x - actorSize.x) << ", " << (stageSize.y - actorSize.y) << ", " << actorSize.x << ", " << actorSize.y;
+  DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", compareParametersString.str())); // Compare with 464, 784, 16, 16
+
+  END_TEST;
+}
+
 int UtcDaliActorPropertyScissorClippingActorSiblings(void)
 {
   // This test checks that an actor is correctly setup for clipping.
@@ -4781,7 +4909,7 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void)
   DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipB));
   DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipC));
   DALI_TEST_CHECK(scissorTrace.FindMethodAndParams("Scissor", clipD));
-  DALI_TEST_CHECK(scissorTrace.CountMethod("Scissor") == 4); // Scissor rect should not be changed in clippingActorE case. So count should be 4.
+  DALI_TEST_EQUALS(scissorTrace.CountMethod("Scissor"), 4, TEST_LOCATION); // Scissor rect should not be changed in clippingActorE case. So count should be 4.
 
   END_TEST;
 }
@@ -7583,6 +7711,61 @@ int UtcDaliChildMovedSignalP(void)
   END_TEST;
 }
 
+int UtcDaliActorSwitchParentP(void)
+{
+  tet_infoline("Testing Actor::UtcDaliActorSwitchParentP");
+  TestApplication application;
+
+  Actor parent1 = Actor::New();
+  Actor child   = Actor::New();
+
+  application.GetScene().Add(parent1);
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION);
+
+  child.OnSceneSignal().Connect(OnSceneCallback);
+  child.OffSceneSignal().Connect(OffSceneCallback);
+
+  // sanity check
+  DALI_TEST_CHECK(gOnSceneCallBackCalled == 0);
+  DALI_TEST_CHECK(gOffSceneCallBackCalled == 0);
+
+  parent1.Add(child);
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 1u, TEST_LOCATION);
+
+  DALI_TEST_CHECK(gOnSceneCallBackCalled == 1);
+  DALI_TEST_CHECK(gOffSceneCallBackCalled == 0);
+
+  Actor parent2 = Actor::New();
+  application.GetScene().Add(parent2);
+
+  bool                  addSignalReceived = false;
+  ChildAddedSignalCheck addedSignal(addSignalReceived, child);
+  DevelActor::ChildAddedSignal(application.GetScene().GetRootLayer()).Connect(&application, addedSignal);
+  DALI_TEST_EQUALS(addSignalReceived, false, TEST_LOCATION);
+
+  bool                    removedSignalReceived = false;
+  ChildRemovedSignalCheck removedSignal(removedSignalReceived, child);
+  DevelActor::ChildRemovedSignal(application.GetScene().GetRootLayer()).Connect(&application, removedSignal);
+  DALI_TEST_EQUALS(removedSignalReceived, false, TEST_LOCATION);
+
+  DevelActor::SwitchParent(child, parent2);
+
+  DALI_TEST_EQUALS(addSignalReceived, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(removedSignalReceived, false, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(parent1.GetChildCount(), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(parent2.GetChildCount(), 1u, TEST_LOCATION);
+
+  DALI_TEST_CHECK(gOnSceneCallBackCalled == 1);
+  DALI_TEST_CHECK(gOffSceneCallBackCalled == 0);
+  DALI_TEST_CHECK(child.GetProperty<bool>(Dali::Actor::Property::CONNECTED_TO_SCENE));
+  DALI_TEST_CHECK(child.GetParent() == parent2);
+
+  END_TEST;
+}
+
 int utcDaliActorCulled(void)
 {
   TestApplication application;
@@ -8371,6 +8554,172 @@ int utcDaliActorPartialUpdateAnimation(void)
   END_TEST;
 }
 
+int utcDaliActorPartialUpdateChangeVisibility(void)
+{
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  tet_infoline("Check the damaged rect with partial update and visibility change");
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+
+  // 1. Actor added, damaged rect is added size of actor
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  // Aligned by 16
+  clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // Ensure the damaged rect is empty
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  // 2. Make the Actor invisible
+  actor.SetProperty(Actor::Property::VISIBLE, false);
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_CHECK(damagedRects.size() > 0);
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // 3. Make the Actor visible again
+  actor.SetProperty(Actor::Property::VISIBLE, true);
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_CHECK(damagedRects.size() > 0);
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int utcDaliActorPartialUpdateOnOffScene(void)
+{
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  tet_infoline("Check the damaged rect with partial update and on/off scene");
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+
+  // 1. Actor added, damaged rect is added size of actor
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  // Aligned by 16
+  clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // Ensure the damaged rect is empty
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  // 2. Remove the Actor from the Scene
+  actor.Unparent();
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_CHECK(damagedRects.size() > 0);
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // 3. Add the Actor to the Scene again
+  application.GetScene().Add(actor);
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_CHECK(damagedRects.size() > 0);
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void)
 {
   TestApplication application;
@@ -8411,20 +8760,20 @@ int UtcDaliActorCaptureAllTouchAfterStartPropertyN(void)
   END_TEST;
 }
 
-int UtcDaliActorTouchAreaPropertyP(void)
+int UtcDaliActorTouchAreaOffsetPropertyP(void)
 {
   TestApplication application;
 
-  Actor   actor     = Actor::New();
-  Vector2 touchArea = actor.GetProperty(DevelActor::Property::TOUCH_AREA).Get<Vector2>();
-  DALI_TEST_EQUALS(touchArea, Vector2::ZERO, TEST_LOCATION);
-  actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2(10.f, 10.f));
-  touchArea = actor.GetProperty(DevelActor::Property::TOUCH_AREA).Get<Vector2>();
-  DALI_TEST_EQUALS(touchArea, Vector2(10.f, 10.f), TEST_LOCATION);
+  Actor     actor           = Actor::New();
+  Rect<int> touchAreaOffset = actor.GetProperty(DevelActor::Property::TOUCH_AREA_OFFSET).Get<Rect<int>>();
+  DALI_TEST_EQUALS(Rect<int>(0, 0, 0, 0), touchAreaOffset, TEST_LOCATION);
+  actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Rect<int>(10, 20, 30, 40));
+  touchAreaOffset = actor.GetProperty(DevelActor::Property::TOUCH_AREA_OFFSET).Get<Rect<int>>();
+  DALI_TEST_EQUALS(Rect<int>(10, 20, 30, 40), touchAreaOffset, TEST_LOCATION);
   END_TEST;
 }
 
-int UtcDaliActorTouchAreaPropertyN(void)
+int UtcDaliActorTouchAreaOffsetPropertyN(void)
 {
   TestApplication application;
 
@@ -8433,12 +8782,12 @@ int UtcDaliActorTouchAreaPropertyN(void)
   // Make sure setting invalid types does not cause a crash
   try
   {
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, 1.0f);
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector2::ONE);
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector3::ONE);
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, Vector4::ONE);
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, Property::Map());
-    actor.SetProperty(DevelActor::Property::TOUCH_AREA, Property::Array());
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, 1.0f);
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector2::ONE);
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector3::ONE);
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Vector4::ONE);
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Property::Map());
+    actor.SetProperty(DevelActor::Property::TOUCH_AREA_OFFSET, Property::Array());
     tet_result(TET_PASS);
   }
   catch(...)