Animation anim = Animation::New( 1.0f );
anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) );
+ anim.Play();
+
+ application.SendNotification();
+ application.Render( static_cast<unsigned int>( 1000.0f ) );
+
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION );
END_TEST;
}
+int UtcDaliCustomActorSizeComponentAnimation(void)
+{
+ TestApplication application;
+ tet_infoline("Testing Size component animation");
+
+ Test::TestCustomActor custom = Test::TestCustomActor::New();
+ float intialWidth( 10.0f );
+
+ DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+ custom.SetSize( intialWidth, 10.0f); // First method
+
+ Animation anim = Animation::New( 1.0f );
+
+ DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+ anim.AnimateTo( Property( custom, Actor::Property::SIZE_WIDTH ), 20.0f );
+
+ DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+ anim.Play(); // Triggers second method ( OnSizeAnimation )
+
+ application.SendNotification();
+ application.Render( static_cast<unsigned int>( 1000.0f ) );
+
+ DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+ DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
+
+ END_TEST;
+
+}
+
int UtcDaliCustomActorOnTouchEvent(void)
{
TestApplication application;
Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
float width = 300.0f;
- float v = 0.0f;
application.SendNotification();
application.Render();
- v = custom.TestGetHeightForWidthBase( width );
+ float v = custom.TestGetHeightForWidthBase( width );
DALI_TEST_CHECK( v == width );
Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
float height = 300.0f;
- float v = 0.0f;
application.SendNotification();
application.Render();
- v = custom.TestGetWidthForHeightBase( height );
+ float v = custom.TestGetWidthForHeightBase( height );
DALI_TEST_CHECK( v == height );
application.SendNotification();
application.Render();
- float v = 9.99f;
- v = custom.TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
+ float v = custom.TestCalculateChildSizeBase( child, Dali::Dimension::ALL_DIMENSIONS );
DALI_TEST_CHECK( v == 0.0f );
END_TEST;
Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
custom.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::ALL_DIMENSIONS);
- bool v = false;
+ bool v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
+ DALI_TEST_CHECK( v == true );
- v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::ALL_DIMENSIONS );
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( v == true );
-
custom.SetResizePolicy(Dali::ResizePolicy::FIXED, Dali::Dimension::ALL_DIMENSIONS);
v = custom.TestRelayoutDependentOnChildrenBase( Dali::Dimension::WIDTH );
+ DALI_TEST_CHECK( v == false );
+
+ // why is this here?
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( v == false );
END_TEST;
}