X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-VisualFactory.cpp;h=b6b42e3ce7e40c910c68902f9b8622210b38a822;hb=f52e1560139d8b38f846be2125b0125a726ed979;hp=fe4c588cb1d4b371273eed4579a76b0678943570;hpb=4ca1c56642540f3deff389fd3716d9c3fca86b9d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index fe4c588..b6b42e3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -372,7 +373,7 @@ int UtcDaliVisualFactoryGetBorderVisual1(void) DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); int blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::ON, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::ON, TEST_LOCATION ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -425,7 +426,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) application.Render(0); int blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::AUTO, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::AUTO, TEST_LOCATION ); Vector4 actualColor(Vector4::ZERO); DALI_TEST_CHECK( gl.GetUniformValue( "borderColor", actualColor ) ); @@ -449,7 +450,7 @@ int UtcDaliVisualFactoryGetBorderVisual2(void) application.SendNotification(); application.Render(0); blendMode = actor.GetRendererAt(0u).GetProperty( Renderer::Property::BLEND_MODE ); - DALI_TEST_EQUALS( static_cast(blendMode), BlendingMode::ON, TEST_LOCATION ); + DALI_TEST_EQUALS( static_cast(blendMode), BlendMode::ON, TEST_LOCATION ); END_TEST; } @@ -966,6 +967,15 @@ int UtcDaliVisualFactoryGetNPatchVisual3(void) DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + ResourceImage image = ResourceImage::New(TEST_NPATCH_FILE_NAME); + Visual::Base nPatchVisual = factory.CreateVisual( image ); + Vector2 visualSize( 20.f, 30.f ), naturalSize(0,0); + nPatchVisual.SetSize( visualSize ); + DALI_TEST_EQUALS( nPatchVisual.GetSize(), visualSize, TEST_LOCATION ); + nPatchVisual.GetNaturalSize( naturalSize ); + DALI_TEST_EQUALS( naturalSize, Vector2( ninePatchImageWidth-2, ninePatchImageHeight-2 ), TEST_LOCATION ); + END_TEST; } @@ -1117,14 +1127,56 @@ int UtcDaliVisualFactoryGetSvgVisual(void) application.SendNotification(); application.Render(); + // renderer is not added to actor until the rasterization is completed. + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + + EventThreadCallback* eventTrigger = EventThreadCallback::Get(); + CallbackBase* callback = eventTrigger->GetCallback(); + + eventTrigger->WaitingForTrigger( 1 );// waiting until the svg image is rasterized. + CallbackBase::Execute( *callback ); + + // renderer is added to actor DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); + // waiting for the resource uploading + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliVisualFactoryGetSvgVisualLarge(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcDaliVisualFactoryGetSvgVisual: Request svg visual with a svg url" ); + + VisualFactory factory = VisualFactory::Get(); + Visual::Base visual = factory.CreateVisual( TEST_SVG_FILE_NAME, ImageDimensions( 2000, 2000 ) ); + DALI_TEST_CHECK( visual ); + + TestGlAbstraction& gl = application.GetGlAbstraction(); + TraceCallStack& textureTrace = gl.GetTextureTrace(); + textureTrace.Enable(true); + + Actor actor = Actor::New(); + Stage::GetCurrent().Add( actor ); + visual.SetOnStage( actor ); + application.SendNotification(); + application.Render(); + + // renderer is not added to actor until the rasterization is completed. + DALI_TEST_CHECK( actor.GetRendererCount() == 0u ); + EventThreadCallback* eventTrigger = EventThreadCallback::Get(); CallbackBase* callback = eventTrigger->GetCallback(); eventTrigger->WaitingForTrigger( 1 );// waiting until the svg image is rasterized. CallbackBase::Execute( *callback ); + // renderer is added to actor DALI_TEST_CHECK( actor.GetRendererCount() == 1u ); // waiting for the resource uploading