X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-LayoutingAnimation.cpp;h=975007053b83d47a8aeb8526be8d06f587737087;hb=b4f3bbb0d784ad6f981351cae3d949f736b8ca36;hp=2bf827acf2added1968b344782649b1623d283c5;hpb=118f87dfe57967bfed8ccdf9143a078eaef1b119;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp b/automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp index 2bf827a..9750070 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp @@ -30,6 +30,7 @@ #include #include <../custom-layout.h> +#include #include @@ -1797,3 +1798,72 @@ int UtcDaliLayouting_DefaultTransition01(void) END_TEST; } +int UtcDaliLayouting_CheckResourceLeak01(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliLayouting_CheckResourceLeak01 - Remove animating layout and add child to stage" ); + + Dali::Toolkit::Impl::DummyControl::constructorCount = 0; + Dali::Toolkit::Impl::DummyControl::destructorCount = 0; + + Stage stage = Stage::GetCurrent(); + auto container = Control::New(); + auto linearLayout = LinearLayout::New(); + linearLayout.SetAnimateLayout( true ); + + DevelControl::SetLayout( container, linearLayout ); + container.SetName( "Container" ); + + stage.Add( container ); + + DummyControl control = DummyControl::New( true ); + control.SetName( "DummyControl01" ); + control.SetSize( 100, 100 ); + container.Add( control ); + + control = DummyControl::New( true ); + control.SetName( "DummyControl02" ); + control.SetSize( 100, 100 ); + container.Add( control ); + + linearLayout.SetAnimateLayout( true ); + + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION ); + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION ); + + // Initial rendering done + application.SendNotification(); + application.Render(static_cast( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ ); + + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION ); + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION ); + + stage.Remove( container ); + container.Reset(); + + application.SendNotification(); + application.Render(static_cast( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ ); + + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION ); + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION ); + + Stage::GetCurrent().Add( control ); + + application.SendNotification(); + application.Render(static_cast( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ ); + + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION ); + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION ); + + stage.Remove( control ); + control.Reset(); + + application.SendNotification(); + application.Render(static_cast( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ ); + + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION ); + DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 2, TEST_LOCATION ); + + END_TEST; +} +