+ END_TEST;
+}
+
+int utcDaliActorVisibilityChangeSignalAfterAnimation(void)
+{
+ TestApplication application;
+ tet_infoline( "Check that the visibility change signal is emitted when the visibility changes when an animation starts" );
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ VisibilityChangedFunctorData data;
+ DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) );
+
+ Animation animation = Animation::New( 1.0f );
+ animation.AnimateTo( Property( actor, Actor::Property::VISIBLE ), false );
+
+ data.Check( false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+ tet_infoline( "Play the animation and check the property value" );
+ animation.Play();
+
+ data.Check( true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+ tet_infoline( "Animation not currently finished, so the current visibility should still be true" );
+ DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render( 1100 ); // After the animation
+
+ DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+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;
+}
+
+int UtcDaliActorLayoutDirectionProperty(void)
+{
+ TestApplication application;
+ tet_infoline( "Check layout direction property" );
+
+ Actor actor0 = Actor::New();
+ DALI_TEST_EQUALS( actor0.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Stage::GetCurrent().Add( actor0 );
+
+ application.SendNotification();
+ application.Render();
+
+ Actor actor1 = Actor::New();
+ DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor2 = Actor::New();
+ DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor3 = Actor::New();
+ DALI_TEST_EQUALS( actor3.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor4 = Actor::New();
+ DALI_TEST_EQUALS( actor4.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor5 = Actor::New();
+ DALI_TEST_EQUALS( actor5.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor6 = Actor::New();
+ DALI_TEST_EQUALS( actor6.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor7 = Actor::New();
+ DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor8 = Actor::New();
+ DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ Actor actor9 = Actor::New();
+ DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ actor1.Add( actor2 );
+ gLayoutDirectionType = LayoutDirection::LEFT_TO_RIGHT;
+ actor2.LayoutDirectionChangedSignal().Connect( LayoutDirectionChanged );
+
+ DALI_TEST_EQUALS( actor1.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), true, TEST_LOCATION );
+ actor1.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+ DALI_TEST_EQUALS( actor1.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), false, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( gLayoutDirectionType, LayoutDirection::RIGHT_TO_LEFT, TEST_LOCATION );
+
+ actor1.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, true );
+ actor0.Add( actor1 );
+ DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ Stage::GetCurrent().Add( actor3 );
+ actor3.Add( actor4 );
+ actor4.Add( actor5 );
+ actor5.Add( actor6 );
+ actor5.Add( actor7 );
+ actor7.Add( actor8 );
+ actor8.Add( actor9 );
+ actor3.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" );
+ actor5.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
+
+ DALI_TEST_EQUALS( actor8.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), true, TEST_LOCATION );
+ actor8.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, false );
+ DALI_TEST_EQUALS( actor8.GetProperty< bool >( Actor::Property::INHERIT_LAYOUT_DIRECTION ), false, TEST_LOCATION );
+
+ actor7.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" );
+
+ DALI_TEST_EQUALS( actor3.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor4.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor5.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor6.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ actor8.SetProperty( Actor::Property::LAYOUT_DIRECTION, "RIGHT_TO_LEFT" );
+ DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ actor7.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::LEFT_TO_RIGHT );
+ DALI_TEST_EQUALS( actor7.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ actor8.SetProperty( Actor::Property::INHERIT_LAYOUT_DIRECTION, true );
+ DALI_TEST_EQUALS( actor8.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor9.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
+
+ 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;
+}
+
+int utcDaliActorCulled(void)
+{
+ TestApplication application;
+ auto stage = Stage::GetCurrent();
+
+ tet_infoline( "Check that the actor is culled if the actor is out of the screen" );
+
+ Actor actor = Actor::New();
+ actor.SetSize( 10.0f, 10.0f );
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ Renderer renderer = Renderer::New(geometry, shader);
+ actor.AddRenderer( renderer );
+
+ stage.Add( actor );
+
+ application.SendNotification();
+ application.Render( 0 );
+
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), false, TEST_LOCATION );
+
+ PropertyNotification notification = actor.AddPropertyNotification( DevelActor::Property::CULLED, LessThanCondition( 0.5f ) );
+ notification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+
+ // Connect NotifySignal
+ bool propertyNotificationSignal( false );
+ PropertyNotification source;
+ CulledPropertyNotificationFunctor f( propertyNotificationSignal, source );
+ notification.NotifySignal().Connect( &application, f ) ;
+
+ actor.SetPosition( 1000.0f, 1000.0f );
+
+ application.SendNotification();
+ application.Render();
+
+ application.SendNotification();
+
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), true, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( propertyNotificationSignal, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( DevelActor::Property::CULLED ), TEST_LOCATION );
+ DALI_TEST_EQUALS( source.GetTarget().GetProperty< bool >( source.GetTargetProperty() ), true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void)
+{
+ TestApplication application;
+ auto stage = Stage::GetCurrent();
+
+ tet_infoline( "Ensure we clear the screen when the last actor is removed" );
+
+ Actor actor = CreateRenderableActor();
+ actor.SetSize( 100.0f, 100.0f );
+ stage.Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ auto& glAbstraction = application.GetGlAbstraction();
+ const auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+ actor.Unparent();
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int utcDaliEnsureRenderWhenMakingLastActorInvisible(void)
+{
+ TestApplication application;
+ auto stage = Stage::GetCurrent();
+
+ tet_infoline( "Ensure we clear the screen when the last actor is made invisible" );
+
+ Actor actor = CreateRenderableActor();
+ actor.SetSize( 100.0f, 100.0f );
+ stage.Add( actor );
+
+ application.SendNotification();
+ application.Render();
+
+ auto& glAbstraction = application.GetGlAbstraction();
+ const auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+ actor.SetVisible( false );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+
+ END_TEST;
+}