X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Actor.cpp;h=7ced69b25dacd6f4f67bb2dca675c823840bc713;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=d5780481f4cfc86bedb0172f5d405d20ae5efa5d;hpb=fdf982a0fc4c7aff8b1dbdd48d60064338ef80ff;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 old mode 100644 new mode 100755 index d578048..7ced69b --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -1269,6 +1269,29 @@ int UtcDaliActorGetCurrentSizeImmediate(void) END_TEST; } +int UtcDaliActorCalculateScreenExtents(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + + actor.SetPosition(Vector3(2.0f, 2.0f, 16.0f)); + actor.SetSize(Vector3{ 1.0f, 1.0f, 1.0f }); + + application.SendNotification(); + application.Render(); + + auto expectedExtent = Rect<>{ -0.5f, -0.5f, 1.0f, 1.0f }; + auto actualExtent = DevelActor::CalculateScreenExtents( actor ); + DALI_TEST_EQUALS( expectedExtent.x, actualExtent.x, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + DALI_TEST_EQUALS( expectedExtent.y, actualExtent.y, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + DALI_TEST_EQUALS( expectedExtent.width, actualExtent.width, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + DALI_TEST_EQUALS( expectedExtent.height, actualExtent.height, Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + + Stage::GetCurrent().Remove( actor ); + END_TEST; +} + // SetPosition(float x, float y) int UtcDaliActorSetPosition01(void) { @@ -3261,6 +3284,7 @@ const PropertyStringIndex PROPERTY_TABLE[] = { "inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN }, { "clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING }, { "opacity", DevelActor::Property::OPACITY, Property::FLOAT }, + { "updateSizeHint", DevelActor::Property::UPDATE_SIZE_HINT, Property::VECTOR2 }, }; const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] ); } // unnamed namespace @@ -7173,6 +7197,36 @@ int utcDaliActorCulled(void) END_TEST; } +int UtcDaliActorUpdateSizeHint(void) +{ + TestApplication application; + + Actor actor = Actor::New(); + Vector3 vector(100.0f, 100.0f, 0.0f); + + DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + + actor.SetSize(vector.x, vector.y); + + + Vector2 updateSizeHint = Vector2(150.f, 150.f); + actor.SetProperty(Dali::DevelActor::Property::UPDATE_SIZE_HINT, updateSizeHint); + + // Flush the queue and render once + application.SendNotification(); + application.Render(); + + + Vector2 currentSizeHint = actor.GetProperty( Dali::DevelActor::Property::UPDATE_SIZE_HINT ).Get< Vector2 >(); + DALI_TEST_EQUALS( currentSizeHint, updateSizeHint, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + // Flush the queue and render once + application.SendNotification(); + application.Render(); + + END_TEST; +} + int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void) { TestApplication application; @@ -7205,7 +7259,7 @@ int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) TestApplication application; auto stage = Stage::GetCurrent(); - tet_infoline( "Ensure we clear the screen when the last actor is removed" ); + tet_infoline( "Ensure we clear the screen when the last actor is made invisible" ); Actor actor = CreateRenderableActor(); actor.SetSize( 100.0f, 100.0f );