[dali_1.3.35] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Actor.cpp
index 9a6f34f..7ab3422 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -231,6 +231,38 @@ struct VisibilityChangedFunctor
   VisibilityChangedFunctorData& data;
 };
 
+
+struct VisibilityChangedVoidFunctor
+{
+  VisibilityChangedVoidFunctor(bool& signalCalled)
+  : mSignalCalled( signalCalled )
+  { }
+
+  void operator()()
+  {
+    mSignalCalled  = true;
+  }
+
+  bool& mSignalCalled;
+};
+
+struct ChildOrderChangedFunctor
+{
+  ChildOrderChangedFunctor(bool& signalCalled, Actor& actor)
+  : mSignalCalled( signalCalled ),
+    mActor( actor )
+  { }
+
+  void operator()( Actor actor )
+  {
+    mSignalCalled  = true;
+    mActor = actor;
+  }
+
+  bool& mSignalCalled;
+  Actor& mActor;
+};
+
 } // anonymous namespace
 
 
@@ -623,6 +655,75 @@ int UtcDaliActorGetParent02(void)
   END_TEST;
 }
 
+int UtcDaliActorCustomProperty(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  float startValue(1.0f);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == startValue );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == startValue );
+
+  actor.SetProperty( index, 5.0f );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == 5.0f );
+  END_TEST;
+}
+
+int UtcDaliActorCustomPropertyIntToFloat(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  float startValue(5.0f);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == startValue );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == startValue );
+
+  actor.SetProperty( index, int(1) );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<float>(index) == 1.0f );
+  END_TEST;
+}
+
+int UtcDaliActorCustomPropertyFloatToInt(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  int startValue(5);
+  Property::Index index = actor.RegisterProperty( "testProperty",  startValue );
+  DALI_TEST_CHECK( actor.GetProperty<int>(index) == startValue );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<int>(index) == startValue );
+
+  actor.SetProperty( index, float(1.5) );
+
+  application.SendNotification();
+  application.Render(0);
+  DALI_TEST_CHECK( actor.GetProperty<int>(index) == 1 );
+  END_TEST;
+}
+
 int UtcDaliActorSetParentOrigin(void)
 {
   TestApplication application;
@@ -4708,6 +4809,12 @@ int UtcDaliActorRaiseLower(void)
   actorB.TouchSignal().Connect( TestTouchCallback2 );
   actorC.TouchSignal().Connect( TestTouchCallback3 );
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
   point.SetState( PointState::DOWN );
@@ -4731,7 +4838,11 @@ int UtcDaliActorRaiseLower(void)
   Property::Value value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
   value.Get( preActorOrder );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Raise();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sort order is calculated before next touch event
   application.SendNotification();
 
@@ -4753,7 +4864,13 @@ int UtcDaliActorRaiseLower(void)
   value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
   value.Get( preActorOrder );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification(); // ensure sort order calculated before next touch event
 
   value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
@@ -4831,6 +4948,12 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   // Set up gl abstraction trace so can query the set uniform order
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableSetUniformCallTrace(true);
@@ -4880,7 +5003,11 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "RaiseToTop ActorA\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification(); // ensure sorting order is calculated before next touch event
 
   application.ProcessEvent( touchEvent );
@@ -4911,7 +5038,13 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "RaiseToTop ActorB\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification(); // Ensure sort order is calculated before next touch event
 
   application.ProcessEvent( touchEvent );
@@ -4942,11 +5075,23 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "LowerToBottom ActorA then ActorB leaving Actor C at Top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5028,6 +5173,11 @@ int UtcDaliActorRaiseAbove(void)
   actorB.TouchSignal().Connect( TestTouchCallback2 );
   actorC.TouchSignal().Connect( TestTouchCallback3 );
 
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
   point.SetState( PointState::DOWN );
@@ -5045,10 +5195,13 @@ int UtcDaliActorRaiseAbove(void)
 
   tet_printf( "Raise actor B Above Actor C\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
-
   application.ProcessEvent( touchEvent );
 
   DALI_TEST_EQUALS( gTouchCallBackCalled,  false, TEST_LOCATION );
@@ -5059,7 +5212,12 @@ int UtcDaliActorRaiseAbove(void)
 
   tet_printf( "Raise actor A Above Actor B\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorB );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
 
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
@@ -5139,6 +5297,12 @@ int UtcDaliActorLowerBelow(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( container ).Connect( &application, f ) ;
+
   // Set up gl abstraction trace so can query the set uniform order
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableSetUniformCallTrace(true);
@@ -5193,7 +5357,11 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor C below Actor B ( actor B and A on same level due to insertion order) so C is below both \n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerBelow( actorB );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5225,7 +5393,13 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor C below Actor A leaving B on top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerBelow( actorA );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5254,7 +5428,13 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor B below Actor C leaving A on top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5333,6 +5513,12 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5363,7 +5549,10 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void)
 
   tet_printf( "Raise actor A Above Actor C which have different parents\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5410,6 +5599,12 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5432,7 +5627,10 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   tet_printf( "Raise actor A Above Actor C which have no parents\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5446,9 +5644,14 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   stage.Add ( actorB );
   tet_printf( "Lower actor A below Actor C when only A is not on stage \n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
 
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
@@ -5463,6 +5666,8 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Adding Actor A to stage, will be on top\n" );
 
   stage.Add ( actorA );
@@ -5470,7 +5675,11 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
   application.Render();
 
   tet_printf( "Raise actor B Above Actor C when only B has a parent\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5483,8 +5692,14 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Lower actor A below Actor C when only A has a parent\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5497,8 +5712,15 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   stage.Add ( actorC );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5545,6 +5767,12 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
   actorA.TouchSignal().Connect( TestTouchCallback );
@@ -5560,7 +5788,10 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
 
   stage.Add ( actorA );
   tet_printf( "Raise actor B Above Actor C but B not parented\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Raise();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
 
   application.SendNotification();
   application.Render();
@@ -5576,7 +5807,12 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   tet_printf( "Raise actor B Above Actor C but B not parented\n" );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5590,9 +5826,14 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Lower actor C below B but C not parented\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5606,9 +5847,14 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Raise actor B to top\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5622,13 +5868,18 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Add ActorB to stage so only Actor C not parented\n" );
 
   stage.Add ( actorB );
 
   tet_printf( "Lower actor C to Bottom, B stays at top\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5687,6 +5938,12 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5707,7 +5964,11 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   tet_infoline( "Raise actor A Above Actor A which is the same actor!!\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorA );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5721,7 +5982,13 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -6444,6 +6711,38 @@ int utcDaliActorVisibilityChangeSignalAfterAnimation(void)
 }
 
 
+int utcDaliActorVisibilityChangeSignalByName(void)
+{
+  TestApplication application;
+  tet_infoline( "Check that the visibility change signal is called when the visibility changes for the actor itself" );
+
+  Actor actor = Actor::New();
+
+  bool signalCalled=false;
+  actor.ConnectSignal( &application, "visibilityChanged", VisibilityChangedVoidFunctor(signalCalled) );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+  actor.SetVisible( false );
+  DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );
+
+  tet_infoline( "Ensure functor is not called if we attempt to change the visibility to what it already is at" );
+  signalCalled = false;
+  actor.SetVisible( false );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+
+  tet_infoline( "Change the visibility using properties, ensure called" );
+  actor.SetProperty( Actor::Property::VISIBLE, true );
+  DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );
+
+  tet_infoline( "Set the visibility to current using properties, ensure not called" );
+  signalCalled = false;
+
+  actor.SetProperty( Actor::Property::VISIBLE, true );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
 static void LayoutDirectionChanged( Actor actor, LayoutDirection::Type type )
 {
   gLayoutDirectionType = type;
@@ -6536,3 +6835,343 @@ int UtcDaliActorLayoutDirectionProperty(void)
 
   END_TEST;
 }
+
+
+struct LayoutDirectionFunctor
+{
+  LayoutDirectionFunctor(bool& signalCalled)
+  : mSignalCalled( signalCalled )
+  {
+  }
+
+  LayoutDirectionFunctor(const LayoutDirectionFunctor& rhs)
+  : mSignalCalled( rhs.mSignalCalled )
+  {
+  }
+
+  void operator()()
+  {
+    mSignalCalled = true;
+  }
+
+  bool& mSignalCalled;
+};
+
+int UtcDaliActorLayoutDirectionSignal(void)
+{
+  TestApplication application;
+  tet_infoline( "Check changing layout direction property sends a signal" );
+
+  Actor actor = Actor::New();
+  DALI_TEST_EQUALS( actor.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+  Stage::GetCurrent().Add( actor );
+  bool signalCalled = false;
+  LayoutDirectionFunctor layoutDirectionFunctor(signalCalled);
+
+  actor.ConnectSignal( &application, "layoutDirectionChanged", layoutDirectionFunctor );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+
+  // Test that writing the same value doesn't send a signal
+  actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+
+  // Test that writing a different value sends the signal
+  signalCalled = false;
+  actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+  DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );
+
+  signalCalled = false;
+  actor.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+  DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+struct ChildAddedSignalCheck
+{
+  ChildAddedSignalCheck( bool& signalReceived, Actor& childHandle )
+  : mSignalReceived( signalReceived ),
+    mChildHandle( childHandle )
+  {
+  }
+
+  void operator() ( Actor childHandle )
+  {
+    mSignalReceived = true;
+    mChildHandle = childHandle;
+  }
+  void operator() ()
+  {
+    mSignalReceived = true;
+    mChildHandle = Actor();
+  }
+
+  bool& mSignalReceived;
+  Actor& mChildHandle;
+};
+
+int UtcDaliChildAddedSignalP1(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildAddedSignalCheck signal( signalReceived, childActor );
+  DevelActor::ChildAddedSignal( stage.GetRootLayer() ).Connect( &application, signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION );
+  signalReceived = false;
+
+  auto actorB = Actor::New();
+  stage.Add( actorB );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor, actorB, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliChildAddedSignalP2(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildAddedSignalCheck signal( signalReceived, childActor );
+  tet_infoline( "Connect to childAdded signal by name" );
+
+  stage.GetRootLayer().ConnectSignal( &application, "childAdded", signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+
+  // Can't test which actor was added; signal signature is void() when connecting via name.
+  signalReceived = false;
+
+  auto actorB = Actor::New();
+  stage.Add( actorB );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliChildAddedSignalN(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildAddedSignalCheck signal( signalReceived, childActor );
+  DevelActor::ChildAddedSignal( stage.GetRootLayer() ).Connect( &application, signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION );
+  signalReceived = false;
+
+  auto actorB = Actor::New();
+  actorA.Add( actorB );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+  END_TEST;
+}
+
+
+struct ChildRemovedSignalCheck
+{
+  ChildRemovedSignalCheck( bool& signalReceived, Actor& childHandle )
+  : mSignalReceived( signalReceived ),
+    mChildHandle( childHandle )
+  {
+  }
+
+  void operator() ( Actor childHandle )
+  {
+    mSignalReceived = true;
+    mChildHandle = childHandle;
+  }
+
+  void operator() ()
+  {
+    mSignalReceived = true;
+  }
+
+  bool& mSignalReceived;
+  Actor& mChildHandle;
+};
+
+int UtcDaliChildRemovedSignalP1(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildRemovedSignalCheck signal( signalReceived, childActor );
+  DevelActor::ChildRemovedSignal( stage.GetRootLayer() ).Connect( &application, signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+  DALI_TEST_CHECK( !childActor );
+
+  stage.Remove( actorA );
+  DALI_TEST_EQUALS( childActor, actorA, TEST_LOCATION );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+
+  signalReceived = false;
+  auto actorB = Actor::New();
+  stage.Add( actorB );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  stage.Remove( actorB );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor, actorB, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliChildRemovedSignalP2(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildAddedSignalCheck signal( signalReceived, childActor );
+  tet_infoline( "Connect to childRemoved signal by name" );
+
+  stage.GetRootLayer().ConnectSignal( &application, "childRemoved", signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  stage.Remove( actorA );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+
+  signalReceived = false;
+  auto actorB = Actor::New();
+  stage.Add( actorB );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  stage.Remove( actorB );
+  DALI_TEST_EQUALS( signalReceived, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliChildRemovedSignalN(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool signalReceived=false;
+  Actor childActor;
+
+  ChildRemovedSignalCheck signal( signalReceived, childActor );
+  DevelActor::ChildRemovedSignal( stage.GetRootLayer() ).Connect( &application, signal );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  auto actorA = Actor::New();
+  stage.Add( actorA );
+
+  auto actorB = Actor::New();
+  actorA.Add( actorB );
+
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+  DALI_TEST_CHECK( ! childActor );
+
+  actorA.Remove( actorB );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+  END_TEST;
+}
+
+
+int UtcDaliChildMovedSignalP(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  bool addedASignalReceived   = false;
+  bool removedASignalReceived = false;
+  bool addedBSignalReceived   = false;
+  bool removedBSignalReceived = false;
+  Actor childActor;
+
+  auto actorA = Actor::New();
+  auto actorB = Actor::New();
+  stage.Add( actorA );
+  stage.Add( actorB );
+
+  ChildAddedSignalCheck addedSignalA( addedASignalReceived, childActor );
+  ChildRemovedSignalCheck removedSignalA( removedASignalReceived, childActor );
+  ChildAddedSignalCheck addedSignalB( addedBSignalReceived, childActor );
+  ChildRemovedSignalCheck removedSignalB( removedBSignalReceived, childActor );
+
+  DevelActor::ChildAddedSignal( actorA ).Connect( &application, addedSignalA );
+  DevelActor::ChildRemovedSignal( actorA ).Connect( &application, removedSignalA );
+  DevelActor::ChildAddedSignal( actorB ).Connect( &application, addedSignalB );
+  DevelActor::ChildRemovedSignal( actorB ).Connect( &application, removedSignalB );
+
+  DALI_TEST_EQUALS( addedASignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION );
+
+  // Create a child of A
+
+  auto child = Actor::New();
+  actorA.Add( child );
+
+  DALI_TEST_EQUALS( addedASignalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( childActor, child, TEST_LOCATION );
+
+  // Move child to B:
+  addedASignalReceived   = false;
+  addedBSignalReceived   = false;
+  removedASignalReceived = false;
+  removedBSignalReceived = false;
+
+  actorB.Add( child ); // Expect this child to be re-parented
+  DALI_TEST_EQUALS( addedASignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedASignalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( addedBSignalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedBSignalReceived, false, TEST_LOCATION );
+
+  // Move child back to A:
+  addedASignalReceived   = false;
+  addedBSignalReceived   = false;
+  removedASignalReceived = false;
+  removedBSignalReceived = false;
+
+  actorA.Add( child ); // Expect this child to be re-parented
+  DALI_TEST_EQUALS( addedASignalReceived, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedASignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( addedBSignalReceived, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( removedBSignalReceived, true, TEST_LOCATION );
+
+
+  END_TEST;
+}