-int UtcDaliDebugRenderingGetVisual4(void)
-{
- EnvironmentVariable::SetTestingEnvironmentVariable(true);
- ToolkitTestApplication application;
- tet_infoline("UtcDaliDebugRenderingGetVisual4: Request visual with empty URL and empty Array");
-
- VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK(factory);
-
- // Test that image visual with null string don't make visual
- for(auto type : {DevelVisual::IMAGE, DevelVisual::ANIMATED_IMAGE, DevelVisual::SVG, DevelVisual::N_PATCH, DevelVisual::ANIMATED_VECTOR_IMAGE})
- {
- Dali::Property::Map map;
- map[Toolkit::Visual::Property::TYPE] = type;
- map[ImageVisual::Property::URL] = "";
- Visual::Base emptyVisual = factory.CreateVisual(map);
- DALI_TEST_CHECK(emptyVisual);
- TestDebugVisual(application.GetScene(), emptyVisual, Visual::WIREFRAME, Vector2::ZERO);
-
- tet_infoline("Check that GetVisualObject returns the actual WireframeVisual");
- Toolkit::Internal::Visual::Base& visualImpl = GetImplementation(emptyVisual).GetVisualObject();
- DALI_TEST_CHECK(dynamic_cast<Toolkit::Internal::WireframeVisual*>(&visualImpl));
-
- tet_infoline("Compare the returned emptyVisual with the visual implementation, should be the same");
- DALI_TEST_CHECK(emptyVisual.GetObjectPtr() == &visualImpl);
- }
-
- // Test that image visual with empty array don't make visual
- for(auto type : {Visual::IMAGE, Visual::ANIMATED_IMAGE})
- {
- Dali::Property::Map map;
- Dali::Property::Array emptyArray;
- map[Toolkit::Visual::Property::TYPE] = type;
- map[ImageVisual::Property::URL] = emptyArray;
- Visual::Base emptyVisual = factory.CreateVisual(map);
- DALI_TEST_CHECK(emptyVisual);
- TestDebugVisual(application.GetScene(), emptyVisual, Visual::WIREFRAME, Vector2::ZERO);
-
- tet_infoline("Check that GetVisualObject returns the actual WireframeVisual");
- Toolkit::Internal::Visual::Base& visualImpl = GetImplementation(emptyVisual).GetVisualObject();
- DALI_TEST_CHECK(dynamic_cast<Toolkit::Internal::WireframeVisual*>(&visualImpl));
-
- tet_infoline("Compare the returned emptyVisual with the visual implementation, should be the same");
- DALI_TEST_CHECK(emptyVisual.GetObjectPtr() == &visualImpl);
- }
-
- EnvironmentVariable::SetTestingEnvironmentVariable(false);
- END_TEST;
-}