X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-VisualFactory.cpp;h=726a7b874866d225725f9468c88675a3662bbe54;hb=0dcf9f8788fc4b48e4b127edcb4a00990e5ff512;hp=6291e500a6951da63c29d2cd49179b9f3ed854ec;hpb=2580d75061499528ff05d00e0e1d5907998900ac;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 6291e50..726a7b8 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -29,6 +29,7 @@ #include #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -1226,11 +1227,6 @@ int UtcDaliVisualFactoryGetNPatchVisual9(void) DALI_TEST_EQUALS(actor2.GetRendererCount(), 0u, TEST_LOCATION); application.GetScene().Add(actor2); - - application.SendNotification(); - application.Render(); - - application.SendNotification(); application.Render(); // Async loading is not finished yet. @@ -1412,7 +1408,7 @@ int UtcDaliNPatchVisualAuxiliaryImage02(void) imageView2[ImageView::Property::IMAGE] = NPATCH_TEST; application.GetScene().Add(imageView2); - DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(3), true, TEST_LOCATION); + DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION); application.SendNotification(); application.Render(); @@ -1529,7 +1525,9 @@ int UtcDaliVisualFactoryGetSvgVisual(void) // Either application.SendNotification() or the trigger can now complete the task. application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION); + + // Wait for loading & rasterization + DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION); // renderer is added to actor DALI_TEST_CHECK(actor.GetRendererCount() == 1u); @@ -1565,7 +1563,9 @@ int UtcDaliVisualFactoryGetSvgVisualLarge(void) // Either application.SendNotification() or the trigger can now complete the task. application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION); + + // Wait for loading & rasterization + DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION); // renderer is added to actor DALI_TEST_CHECK(actor.GetRendererCount() == 1u); @@ -1609,7 +1609,9 @@ int UtcDaliVisualFactoryGetSvgVisualAtlas(void) DALI_TEST_CHECK(actor.GetRendererCount() == 0u); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION); + + // Wait for loading & rasterization + DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(2), true, TEST_LOCATION); // renderer is added to actor DALI_TEST_CHECK(actor.GetRendererCount() == 1u); @@ -2787,3 +2789,41 @@ int UtcDaliVisualFactoryGetAnimatedImageVisual2(void) END_TEST; } + + +int UtcDaliVisualFactoryGetPreCompiler(void) +{ + ToolkitTestApplication application; + tet_infoline("UtcDaliVisualFactoryGetAnimatedImageVisual2: Request animated image visual with a Property::Map, test custom wrap mode and pixel area"); + + + std::vector precompiledShaderList; + DALI_TEST_CHECK(precompiledShaderList.size() == 0u); // before Get Shader + ShaderPreCompiler::Get().GetPreCompileShaderList(precompiledShaderList); + DALI_TEST_CHECK(precompiledShaderList.size() == 0u); // after Get Shader + + VisualFactory factory = VisualFactory::Get(); + DALI_TEST_CHECK(factory); + + factory.UsePreCompiledShader(); + + ShaderPreCompiler::Get().GetPreCompileShaderList(precompiledShaderList); + DALI_TEST_CHECK(precompiledShaderList.size() != 0u); // after Get Shader + + Property::Map propertyMap; + propertyMap.Insert(Toolkit::Visual::Property::TYPE, Visual::IMAGE); + propertyMap.Insert(ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME); + Visual::Base visual = factory.CreateVisual(propertyMap); + DALI_TEST_CHECK(visual); + + DummyControl actor = DummyControl::New(true); + DummyControlImpl& dummyImpl = static_cast(actor.GetImplementation()); + dummyImpl.RegisterVisual(Control::CONTROL_PROPERTY_END_INDEX + 1, visual); + actor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 200.f)); + application.GetScene().Add(actor); + + application.SendNotification(); + application.Render(); + + END_TEST; +}