Removed On(...)Event()
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-TypeRegistry.cpp
index feabd0e..5388fe9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
 #include <dali/internal/event/common/type-info-impl.h>
-#include <dali/integration-api/events/long-press-gesture-event.h>
-#include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/integration-api/events/pinch-gesture-event.h>
-#include <dali/integration-api/events/tap-gesture-event.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/hover-event-integ.h>
 
@@ -40,7 +36,7 @@ struct SignalData
   SignalData()
   : functorCalled( false ),
     voidFunctorCalled( false ),
-    receivedGesture( Gesture::Clear ),
+    receivedGesture( ),
     pressedActor()
   {}
 
@@ -49,9 +45,7 @@ struct SignalData
     functorCalled = false;
     voidFunctorCalled = false;
 
-    receivedGesture.numberOfTouches = 0u;
-    receivedGesture.screenPoint = Vector2(0.0f, 0.0f);
-    receivedGesture.localPoint = Vector2(0.0f, 0.0f);
+    receivedGesture.Reset();
 
     pressedActor.Reset();
   }
@@ -82,70 +76,6 @@ struct GestureReceivedFunctor
   SignalData& signalData;
 };
 
-// Generate a LongPressGestureEvent to send to Core
-Integration::LongPressGestureEvent GenerateLongPress(
-    Gesture::State state,
-    unsigned int numberOfTouches,
-    Vector2 point)
-{
-  Integration::LongPressGestureEvent longPress( state );
-
-  longPress.numberOfTouches = numberOfTouches;
-  longPress.point = point;
-
-  return longPress;
-}
-
-// Generate a PanGestureEvent to send to Core
-Integration::PanGestureEvent GeneratePan(
-    Gesture::State state,
-    Vector2 previousPosition,
-    Vector2 currentPosition,
-    unsigned long timeDelta,
-    unsigned int numberOfTouches = 1,
-    unsigned int time = 1u)
-{
-  Integration::PanGestureEvent pan(state);
-
-  pan.previousPosition = previousPosition;
-  pan.currentPosition = currentPosition;
-  pan.timeDelta = timeDelta;
-  pan.numberOfTouches = numberOfTouches;
-  pan.time = time;
-
-  return pan;
-}
-// Generate a PinchGestureEvent to send to Core
-Integration::PinchGestureEvent GeneratePinch(
-    Gesture::State state,
-    float scale,
-    float speed,
-    Vector2 centerpoint)
-{
-  Integration::PinchGestureEvent pinch(state);
-
-  pinch.scale = scale;
-  pinch.speed = speed;
-  pinch.centerPoint = centerpoint;
-
-  return pinch;
-}
-// Generate a TapGestureEvent to send to Core
-Integration::TapGestureEvent GenerateTap(
-    Gesture::State state,
-    unsigned int numberOfTaps,
-    unsigned int numberOfTouches,
-    Vector2 point)
-{
-  Integration::TapGestureEvent tap( state );
-
-  tap.numberOfTaps = numberOfTaps;
-  tap.numberOfTouches = numberOfTouches;
-  tap.point = point;
-
-  return tap;
-}
-
 //
 // Create function as Init function called
 //
@@ -193,7 +123,7 @@ struct MyTestCustomActor : public CustomActorImpl
   typedef Signal< void ()> SignalType;
   typedef Signal< void (float)> SignalTypeFloat;
 
-  MyTestCustomActor() : CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS ) )
+  MyTestCustomActor() : CustomActorImpl( ActorFlags() )
   { }
 
   virtual ~MyTestCustomActor()
@@ -204,10 +134,10 @@ struct MyTestCustomActor : public CustomActorImpl
   }
 
   // From CustomActorImpl
-  virtual void OnStageConnection( int depth )
+  virtual void OnSceneConnection( int depth )
   {
   }
-  virtual void OnStageDisconnection()
+  virtual void OnSceneDisconnection()
   {
   }
   virtual void OnChildAdd(Actor& child)
@@ -222,22 +152,6 @@ struct MyTestCustomActor : public CustomActorImpl
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
   {
   }
-  virtual bool OnTouchEvent(const TouchEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnWheelEvent(const WheelEvent& event)
-  {
-    return true;
-  }
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return true;
-  }
   virtual void OnKeyInputFocusGained()
   {
   }
@@ -577,7 +491,7 @@ public:
 BaseHandle CreateNamedActorType()
 {
   Actor actor = Actor::New();
-  actor.SetName( "NamedActor" );
+  actor.SetProperty( Actor::Property::NAME, "NamedActor" );
   return actor;
 }
 
@@ -640,6 +554,66 @@ int UtcDaliTypeRegistryAssignmentOperatorP(void)
   END_TEST;
 }
 
+int UtcDaliTypeRegistryMoveConstructor(void)
+{
+  TestApplication application;
+
+  TypeRegistry registry = TypeRegistry::Get();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+  TypeRegistry movedRegistry = std::move( registry );
+  DALI_TEST_CHECK( movedRegistry );
+  DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+  DALI_TEST_CHECK( !registry );
+
+  Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( info );
+  DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+  Dali::TypeInfo movedInfo = std::move( info );
+  DALI_TEST_CHECK( movedInfo );
+  DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+  DALI_TEST_CHECK( !info );
+
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryMoveAssignment(void)
+{
+  TestApplication application;
+
+  TypeRegistry registry = TypeRegistry::Get();
+  DALI_TEST_CHECK( registry );
+  DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+  TypeRegistry movedRegistry;
+  movedRegistry = std::move( registry );
+  DALI_TEST_CHECK( movedRegistry );
+  DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+  DALI_TEST_CHECK( !registry );
+
+  Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+  DALI_TEST_CHECK( info );
+  DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+  Dali::TypeInfo movedInfo;
+  movedInfo = std::move( info );
+  DALI_TEST_CHECK( movedInfo );
+  DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+  DALI_TEST_CHECK( !info );
+
+  END_TEST;
+}
+
 int UtcDaliTypeRegistryAssignP(void)
 {
   TestApplication application;
@@ -667,7 +641,7 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeNameP(void)
   DALI_TEST_CHECK( type );
   CameraActor ca = CameraActor::DownCast(type.CreateInstance());
   DALI_TEST_CHECK( ca );
-  Stage::GetCurrent().Add( ca );
+  application.GetScene().Add( ca );
   application.Render();
 
   // animations
@@ -837,7 +811,7 @@ int UtcDaliTypeRegistryTypeRegistrationForNamedTypeP(void)
   Actor namedActor( Actor::DownCast( namedHandle ) );
   DALI_TEST_CHECK( namedActor );
 
-  DALI_TEST_CHECK( namedActor.GetName() == "NamedActor" );
+  DALI_TEST_CHECK( namedActor.GetProperty< std::string >( Actor::Property::NAME ) == "NamedActor" );
   DALI_TEST_CHECK( type.GetName() == "MyNamedActor" );
   DALI_TEST_CHECK( type.GetBaseName() == "Actor" );
 
@@ -1074,7 +1048,7 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   typeInfo.GetPropertyIndices( indices );
 
   size_t typePropertyCount = typeInfo.GetPropertyCount();
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), Actor::New().GetPropertyCount() + 1u, TEST_LOCATION );
   DALI_TEST_EQUALS( indices.Size(), typePropertyCount, TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by two
@@ -1129,7 +1103,7 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   unsigned int customPropertyCount( customActor.GetPropertyCount() );
 
@@ -1164,7 +1138,7 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
@@ -1239,7 +1213,7 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void)
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   unsigned int customPropertyCount( customActor.GetPropertyCount() );
 
@@ -1267,10 +1241,10 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void)
   // Check the animatable property type
   DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), Property::FLOAT, TEST_LOCATION );
 
-  // Check property count of type-info is 1
+  // Check property count of type-info
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
@@ -1376,10 +1350,10 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Check the animatable property type
   DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), animatablePropertyType, TEST_LOCATION );
 
-  // Check property count of type-info is 1
+  // Check property count of type-info
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Register animatable property components
   std::string animatablePropertyComponentName1( "animatableProp1X" );
@@ -1942,11 +1916,11 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void)
   Actor a = Actor::DownCast(hdl);
   DALI_TEST_CHECK( a );
 
-  a.SetVisible(false);
+  a.SetProperty( Actor::Property::VISIBLE,false);
 
   application.SendNotification();
   application.Render(0);
-  DALI_TEST_CHECK(!a.IsVisible());
+  DALI_TEST_CHECK(!a.GetCurrentProperty< bool >( Actor::Property::VISIBLE ));
 
   Property::Map attributes;
 
@@ -1954,7 +1928,7 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void)
 
   application.SendNotification();
   application.Render(0);
-  DALI_TEST_CHECK(a.IsVisible());
+  DALI_TEST_CHECK(a.GetCurrentProperty< bool >( Actor::Property::VISIBLE ));
 
   DALI_TEST_CHECK(!hdl.DoAction("unknownAction",  attributes));
   END_TEST;
@@ -2057,24 +2031,14 @@ int UtcDaliPropertyRegistrationPropertyWritableP(void)
 
 int UtcDaliPropertyRegistrationPropertyWritableN(void)
 {
-  // Currently Actors don't register properties with the type registry
-
   TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) );
   Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
 
-  try
-  {
-    typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR);
-    tet_result( TET_FAIL );
+  DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR), true, TEST_LOCATION );
 
-  }
-  catch ( DaliException& e )
-  {
-     DALI_TEST_ASSERT( e, "Cannot find property index", TEST_LOCATION );
-  }
   END_TEST;
-
 }
+
 int UtcDaliPropertyRegistrationPropertyAnimatable(void)
 {
   TestApplication application;
@@ -2111,7 +2075,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatable(void)
   END_TEST;
 }
 
-int UtcDaliPropertyRegistrationInvalidGetAndSet(void)
+int UtcDaliPropertyRegistrationUnregisteredGetAndSet(void)
 {
   TestApplication application;
   int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 2000;
@@ -2125,47 +2089,14 @@ int UtcDaliPropertyRegistrationInvalidGetAndSet(void)
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
 
-  // Try to set an index that hasn't been added
-  try
-  {
-    customActor.SetProperty( propertyIndex, true );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
-
-  try
-  {
-    customActor.SetProperty( animatablePropertyIndex, true );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
+  // Try to set an index that hasn't been registered, this is a no-op for now, to be fixed in future
+  customActor.SetProperty( propertyIndex, true );
+//  DALI_TEST_EQUALS( true, customActor.GetProperty( propertyIndex ).Get<bool>(), TEST_LOCATION);
 
-  // Try to get an index that hasn't been added
-  try
-  {
-    (void) customActor.GetProperty< bool >( propertyIndex );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
+  // Try to set an index that hasn't been registered
+  customActor.SetProperty( animatablePropertyIndex, true );
+  DALI_TEST_EQUALS( true, customActor.GetProperty( animatablePropertyIndex ).Get<bool>(), TEST_LOCATION);
 
-  try
-  {
-    (void) customActor.GetProperty< bool >( animatablePropertyIndex );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
   END_TEST;
 }
 
@@ -2175,9 +2106,9 @@ int UtcDaliLongPressGestureDetectorTypeRegistry(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
 
   // Register Type
   TypeInfo type;
@@ -2201,9 +2132,9 @@ int UtcDaliLongPressGestureDetectorTypeRegistry(void)
   application.Render();
 
   // Emit gesture
-  application.ProcessEvent(GenerateLongPress(Gesture::Possible, 1u, Vector2(50.0f, 10.0f)));
-  application.ProcessEvent(GenerateLongPress(Gesture::Started, 1u, Vector2(50.0f, 10.0f)));
-  application.ProcessEvent(GenerateLongPress(Gesture::Finished, 1u, Vector2(50.0f, 10.0f)));
+  TestGenerateLongPress( application, 50.0f, 10.0f );
+  TestEndLongPress( application, 50.0f, 10.0f );
+
   DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -2213,9 +2144,9 @@ int UtcDaliPanGestureDetectorTypeRegistry(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
 
   // Register Type
   TypeInfo type;
@@ -2239,9 +2170,7 @@ int UtcDaliPanGestureDetectorTypeRegistry(void)
   application.Render();
 
   // Emit gesture
-  application.ProcessEvent(GeneratePan(Gesture::Possible, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
-  application.ProcessEvent(GeneratePan(Gesture::Started, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
-  application.ProcessEvent(GeneratePan(Gesture::Finished, Vector2(10.0f, 20.0f), Vector2(20.0f, 20.0f), 10));
+  TestGenerateMiniPan( application );
   DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -2251,9 +2180,9 @@ int UtcDaliPinchGestureDetectorTypeRegistry(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
 
   // Register Type
   TypeInfo type;
@@ -2277,7 +2206,45 @@ int UtcDaliPinchGestureDetectorTypeRegistry(void)
   application.Render();
 
   // Emit gesture
-  application.ProcessEvent(GeneratePinch(Gesture::Started, 10.0f, 50.0f, Vector2(20.0f, 10.0f)));
+  TestGeneratePinch( application );
+
+  DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliRotationGestureDetectorTypeRegistry(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
+
+  // Register Type
+  TypeInfo type;
+  type = TypeRegistry::Get().GetTypeInfo( "RotationGestureDetector" );
+  DALI_TEST_CHECK( type );
+  BaseHandle handle = type.CreateInstance();
+  DALI_TEST_CHECK( handle );
+  RotationGestureDetector detector = RotationGestureDetector::DownCast( handle );
+  DALI_TEST_CHECK( detector );
+
+  // Attach actor to detector
+  SignalData data;
+  GestureReceivedFunctor functor( data );
+  detector.Attach(actor);
+
+  // Connect to signal through type
+  handle.ConnectSignal( &application, "rotationDetected",  functor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Emit gesture
+  TestGenerateRotation( application );
+
   DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -2287,9 +2254,9 @@ int UtcDaliTapGestureDetectorTypeRegistry(void)
   TestApplication application;
 
   Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+  actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+  application.GetScene().Add(actor);
 
   // Register Type
   TypeInfo type;
@@ -2313,8 +2280,8 @@ int UtcDaliTapGestureDetectorTypeRegistry(void)
   application.Render();
 
   // Emit gesture
-  application.ProcessEvent(GenerateTap(Gesture::Possible, 1u, 1u, Vector2(50.0f, 10.0f)));
-  application.ProcessEvent(GenerateTap(Gesture::Started, 1u, 1u, Vector2(50.0f, 10.0f)));
+  TestGenerateTap( application, 50.0, 10.0, 100 );
+
   DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
   END_TEST;
 }
@@ -2407,7 +2374,7 @@ int UtcDaliTypeInfoGetSignalNameP(void)
 
   std::string name = typeInfo.GetSignalName(0);
 
-  DALI_TEST_EQUALS( name, "touched", TEST_LOCATION );
+  DALI_TEST_EQUALS( name, "hovered", TEST_LOCATION );
 
   TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" );
 
@@ -2415,13 +2382,11 @@ int UtcDaliTypeInfoGetSignalNameP(void)
   bool foundSignal = false;
   for( std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++ )
   {
-
-       std::string name = typeInfo2.GetSignalName( i );
-       if( name == "touched")
-       {
-         foundSignal = true;
-       }
-
+    std::string name = typeInfo2.GetSignalName( i );
+    if( name == "hovered")
+    {
+      foundSignal = true;
+    }
   }
 
   DALI_TEST_EQUALS( foundSignal, true, TEST_LOCATION );
@@ -2490,7 +2455,7 @@ int UtcDaliTypeInfoGetPropertyCountP1(void)
   DALI_TEST_CHECK( typeInfo );
   size_t actorPropertyCount = typeInfo.GetPropertyCount();
 
-  DALI_TEST_EQUALS( actorPropertyCount == 0 , true, TEST_LOCATION ); // No event only props
+  DALI_TEST_EQUALS( actorPropertyCount, Actor::New().GetPropertyCount(), TEST_LOCATION ); // No event only props
   END_TEST;
 }
 
@@ -2506,7 +2471,7 @@ int UtcDaliTypeInfoGetPropertyCountP2(void)
   typeInfo.GetPropertyIndices( indices );
 
   DALI_TEST_EQUALS( propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION );
-  DALI_TEST_EQUALS( propertyCount == 2, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( propertyCount, Actor::New().GetPropertyCount() + 2, TEST_LOCATION );
 
   END_TEST;
 }
@@ -2529,7 +2494,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGet01(void)
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   tet_infoline( "Set the value and ensure it changes straight away" );
   DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 0.0f, TEST_LOCATION );
@@ -2573,7 +2538,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   tet_infoline( "Get the component values, they should be the default value of the base-property" );
   DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
@@ -2640,7 +2605,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   tet_infoline( "Get the component values, they should be the default value of the base-property" );
   DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
@@ -2718,7 +2683,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents
   DALI_TEST_CHECK( handle );
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
-  Stage::GetCurrent().Add(customActor);
+  application.GetScene().Add(customActor);
 
   tet_infoline( "Get the component values, they should be the default value of the base-property" );
   DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
@@ -2778,3 +2743,453 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents
 
   END_TEST;
 }
+
+
+int UtcDaliTypeInfoRegisterChildProperties01(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register child properties on a type via name" );
+
+  auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+  auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( customActorTypeInfo );
+  DALI_TEST_CHECK( myCustomTypeInfo );
+
+  const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+  const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+  const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+  auto customActor = MyTestCustomActor::New();
+  application.GetScene().Add( customActor );
+  auto child = Actor::New();
+  customActor.Add( child );
+
+  child.SetProperty( WIDTH_SPECIFICATION, 33 );
+
+  auto value = child.GetProperty( WIDTH_SPECIFICATION );
+  DALI_TEST_EQUALS( value, Property::Value(33), TEST_LOCATION );
+
+  child.SetProperty( HEIGHT_SPECIFICATION, 44 );
+  value = child.GetProperty( HEIGHT_SPECIFICATION );
+  DALI_TEST_EQUALS( value, Property::Value(44), TEST_LOCATION );
+
+  child.SetProperty( MARGIN_SPECIFICATION, Extents(10, 10, 10, 10) );
+  value = child.GetProperty( MARGIN_SPECIFICATION );
+  DALI_TEST_EQUALS( value, Property::Value(Extents(10,10,10,10)), TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties02(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Register child properties on a type via name" );
+
+  auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+  auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( customActorTypeInfo );
+  DALI_TEST_CHECK( myCustomTypeInfo );
+
+  const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+  const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+  const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+
+  auto index = customActorTypeInfo.GetChildPropertyIndex( "widthSpecification" );
+  DALI_TEST_EQUALS( index, WIDTH_SPECIFICATION, TEST_LOCATION );
+
+  index = customActorTypeInfo.GetChildPropertyIndex( "heightSpecification" );
+  DALI_TEST_EQUALS( index, HEIGHT_SPECIFICATION, TEST_LOCATION );
+
+  index = customActorTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+  DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
+
+  index = myCustomTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+  DALI_TEST_EQUALS( index, MARGIN_SPECIFICATION, TEST_LOCATION );
+
+
+  auto name = customActorTypeInfo.GetChildPropertyName( WIDTH_SPECIFICATION );
+  DALI_TEST_EQUALS( name, "widthSpecification", TEST_LOCATION );
+
+  name = customActorTypeInfo.GetChildPropertyName( HEIGHT_SPECIFICATION );
+  DALI_TEST_EQUALS( name, "heightSpecification", TEST_LOCATION );
+
+  name = myCustomTypeInfo.GetChildPropertyName( MARGIN_SPECIFICATION );
+  DALI_TEST_EQUALS( name, "marginSpecification", TEST_LOCATION );
+
+
+  auto type = customActorTypeInfo.GetChildPropertyType( WIDTH_SPECIFICATION );
+  DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+  type = customActorTypeInfo.GetChildPropertyType( HEIGHT_SPECIFICATION );
+  DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+  type = myCustomTypeInfo.GetChildPropertyType( MARGIN_SPECIFICATION );
+  DALI_TEST_EQUALS( type, Property::EXTENTS, TEST_LOCATION );
+
+
+  END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties03(void)
+{
+  TestApplication application;
+  TypeRegistry typeRegistry = TypeRegistry::Get();
+
+  tet_infoline( "Check registered child properties can be retrieved" );
+
+  auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+  auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+  DALI_TEST_CHECK( customActorTypeInfo );
+  DALI_TEST_CHECK( myCustomTypeInfo );
+
+  const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+  const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+  const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+  ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+  Property::IndexContainer indices;
+  myCustomTypeInfo.GetChildPropertyIndices( indices );
+
+  auto result = std::find( indices.Begin(), indices.End(), WIDTH_SPECIFICATION );
+  DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+  result = std::find( indices.Begin(), indices.End(), HEIGHT_SPECIFICATION );
+  DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+  result = std::find( indices.Begin(), indices.End(), MARGIN_SPECIFICATION );
+  DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetActionNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    unsigned long arg1(0u);
+    instance.GetActionName(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetSignalNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    unsigned long arg1(0u);
+    instance.GetSignalName(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetCreatorNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetCreator();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetBaseNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetBaseName();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoCreateInstanceNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.CreateInstance();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetActionCountNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetActionCount();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetSignalCountNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetSignalCount();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetPropertyNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    int arg1(0);
+    instance.GetPropertyName(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetPropertyCountNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetPropertyCount();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetPropertyIndicesNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    Dali::Vector<int> arg1;
+    instance.GetPropertyIndices(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetChildPropertyNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    int arg1(0);
+    instance.GetChildPropertyName(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetChildPropertyTypeNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    int arg1(0);
+    instance.GetChildPropertyType(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetChildPropertyIndexNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    std::string arg1;
+    instance.GetChildPropertyIndex(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetChildPropertyIndicesNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    Dali::Vector<int> arg1;
+    instance.GetChildPropertyIndices(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeInfoGetNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeInfo instance;
+  try
+  {
+    instance.GetName();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryGetTypeInfoNegative01(void)
+{
+  TestApplication application;
+  Dali::TypeRegistry instance;
+  try
+  {
+    std::string arg1;
+    instance.GetTypeInfo(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryGetTypeInfoNegative02(void)
+{
+  TestApplication application;
+  Dali::TypeRegistry instance;
+  try
+  {
+    instance.GetTypeInfo(typeid(unsigned int));
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryGetTypeNameNegative(void)
+{
+  TestApplication application;
+  Dali::TypeRegistry instance;
+  try
+  {
+    unsigned long arg1(0u);
+    instance.GetTypeName(arg1);
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}
+
+int UtcDaliTypeRegistryGetTypeNameCountNegative(void)
+{
+  TestApplication application;
+  Dali::TypeRegistry instance;
+  try
+  {
+    instance.GetTypeNameCount();
+    DALI_TEST_CHECK(false); // Should not get here
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(true); // We expect an assert
+  }
+  END_TEST;
+}