X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Actor.cpp;h=000fbda0f3c505ea2f059ecf7a05b6b10af98b5e;hb=a087966c4e674df001d1e1ad68db0a9889bf075a;hp=44131153cc914d2ffff9504c90a40941ab7f1f7c;hpb=fa37cda1d6df0ad53d00aba55b388c73c667c6e2;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 4413115..000fbda 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -8578,6 +8578,83 @@ int utcDaliActorGetSizeAfterAnimation(void) END_TEST; } +int utcDaliActorGetSizeAfterAnimation2(void) +{ + TestApplication application; + tet_infoline("Check the actor size before / after an animation is finished if before size is equal to animation target size"); + + Vector3 actorSize(100.0f, 100.0f, 0.0f); + + Actor actor = Actor::New(); + actor.SetProperty(Actor::Property::SIZE, actorSize); + actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(actor); + + // Size should be updated without rendering. + Vector3 size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + application.SendNotification(); + application.Render(); + + // Size and current size should be updated. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); + + Vector3 currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(actorSize.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); + + // Set size again + actorSize = Vector3(200.0f, 200.0f, 0.0f); + actor.SetProperty(Actor::Property::SIZE, actorSize); + + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + Vector3 targetValue(actorSize); + + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetValue); + animation.Play(); + + // Size should be updated without rendering. + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + application.SendNotification(); + application.Render(100); // During the animation + + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); + + // We should get target value because targetValue is equal to current actor size. + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.width, actor.GetCurrentProperty(Actor::Property::SIZE_WIDTH), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.height, actor.GetCurrentProperty(Actor::Property::SIZE_HEIGHT), TEST_LOCATION); + DALI_TEST_EQUALS(targetValue.depth, actor.GetCurrentProperty(Actor::Property::SIZE_DEPTH), TEST_LOCATION); + + application.SendNotification(); + application.Render(1000); // After animation finished + + size = actor.GetProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + currentSize = actor.GetCurrentProperty(Actor::Property::SIZE).Get(); + DALI_TEST_EQUALS(currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION); + + END_TEST; +} + int utcDaliActorRelayoutAndAnimation(void) { TestApplication application;