X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-DebugRendering.cpp;h=b4ea19b56e6e36fd6a4b7fb53126dcd193617e06;hb=56f0e94bab1f9ecc097c4a5209716cdc1ede7715;hp=734885955fb251fd76d23cc47f95009ee64485ff;hpb=8baeadfe23cbb78ccc879aec3350edde7bf8424a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp index 7348859..b4ea19b 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,6 @@ #include #include #include -#include -#include -#include -#include #include @@ -51,7 +47,7 @@ void TestDebugVisual( Visual::Base& visual, Visual::Type actualType, Vector2 exp Property::Map propertyMap; visual.CreatePropertyMap( propertyMap ); - Property::Value* typeValue = propertyMap.Find( Visual::Property::TYPE, Property::INTEGER ); + Property::Value* typeValue = propertyMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER ); if ( typeValue ) { DALI_TEST_CHECK( typeValue->Get() == actualType ); @@ -129,7 +125,7 @@ int UtcDaliDebugRenderingGetVisual1(void) // Test that image visual is replaced with debug visual Property::Map propertyMap4; - propertyMap4.Insert( Visual::Property::TYPE, Visual::IMAGE ); + propertyMap4.Insert( Toolkit::Visual::Property::TYPE, Visual::IMAGE ); propertyMap4.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); propertyMap4.Insert( ImageVisual::Property::DESIRED_WIDTH, 50.f ); propertyMap4.Insert( ImageVisual::Property::DESIRED_HEIGHT, 100.f ); @@ -143,21 +139,21 @@ int UtcDaliDebugRenderingGetVisual1(void) // // Property::Map propertyMap5; - propertyMap5.Insert( Visual::Property::TYPE, Visual::IMAGE ); + propertyMap5.Insert( Toolkit::Visual::Property::TYPE, Visual::SVG ); propertyMap5.Insert( ImageVisual::Property::URL, TEST_SVG_FILE_NAME ); Visual::Base svgVisual = factory.CreateVisual( propertyMap5 ); DALI_TEST_CHECK( svgVisual ); - TestDebugVisual( svgVisual, Visual::IMAGE, Vector2(100.f, 100.f) ); + TestDebugVisual( svgVisual, Visual::SVG, Vector2(100.f, 100.f) ); // Test that AnimatedImageVisual is replaced with debug visual // TEST_GIF_FILE: anim.gif // resolution: 50*50, frame count: 4, frame delay: 0.2 second for each frame Property::Map propertyMap6; - propertyMap6.Insert( Visual::Property::TYPE, Visual::IMAGE ); + propertyMap6.Insert( Toolkit::Visual::Property::TYPE, Visual::ANIMATED_IMAGE ); propertyMap6.Insert( ImageVisual::Property::URL, TEST_GIF_FILE_NAME ); Visual::Base animatedImageVisual = factory.CreateVisual( propertyMap6 ); DALI_TEST_CHECK( animatedImageVisual ); - TestDebugVisual( animatedImageVisual, Visual::IMAGE, Vector2(50.f, 50.f) ); + TestDebugVisual( animatedImageVisual, Visual::ANIMATED_IMAGE, Vector2(50.f, 50.f) ); // Test that text visual is replaced with debug visual @@ -172,7 +168,7 @@ int UtcDaliDebugRenderingGetVisual1(void) fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf" ); Property::Map propertyMap7; - propertyMap7.Insert( Visual::Property::TYPE, DevelVisual::TEXT ); + propertyMap7.Insert( Toolkit::Visual::Property::TYPE, Visual::TEXT ); propertyMap7.Insert( TextVisual::Property::ENABLE_MARKUP, true ); propertyMap7.Insert( TextVisual::Property::TEXT, "Hello world" ); propertyMap7.Insert( TextVisual::Property::MULTI_LINE, true ); @@ -188,6 +184,15 @@ int UtcDaliDebugRenderingGetVisual1(void) const float height = textVisual.GetHeightForWidth( 40.f ); DALI_TEST_EQUALS( height, 40.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION ); + // Test that NPatchVisual is replaced with debug visual + // TEST_NPATCH_FILE_NAME: image_01.9.jpg + Property::Map propertyMap8; + propertyMap8.Insert( Toolkit::Visual::Property::TYPE, Visual::N_PATCH ); + propertyMap8.Insert( ImageVisual::Property::URL, TEST_NPATCH_FILE_NAME ); + Visual::Base nPatchVisual = factory.CreateVisual( propertyMap8 ); + DALI_TEST_CHECK( nPatchVisual ); + TestDebugVisual( nPatchVisual, Visual::N_PATCH, Vector2::ZERO ); + EnvironmentVariable::SetTestingEnvironmentVariable(false); END_TEST; } @@ -203,7 +208,7 @@ int UtcDaliDebugRenderingGetVisual2(void) // Test that color visual is replaced with debug visual Dali::Property::Map map; - map[ Visual::Property::TYPE ] = Visual::COLOR; + map[ Toolkit::Visual::Property::TYPE ] = Visual::COLOR; map[ ColorVisual::Property::MIX_COLOR ] = Color::CYAN; Visual::Base colorVisual = factory.CreateVisual( map); @@ -212,7 +217,7 @@ int UtcDaliDebugRenderingGetVisual2(void) // Test that border visual is replaced with debug visual map.Clear(); - map[ Visual::Property::TYPE ] = Visual::BORDER; + map[ Toolkit::Visual::Property::TYPE ] = Visual::BORDER; map[ BorderVisual::Property::COLOR ] = Color::GREEN; map[ BorderVisual::Property::SIZE ] = 2.f; Visual::Base borderVisual = factory.CreateVisual( map ); @@ -228,7 +233,7 @@ int UtcDaliDebugRenderingGetVisual2(void) // Test that n patch visual is replaced with debug visual Visual::Base nPatchVisual = factory.CreateVisual( TEST_NPATCH_FILE_NAME, ImageDimensions() ); DALI_TEST_CHECK( nPatchVisual ); - TestDebugVisual( nPatchVisual, Visual::IMAGE, Vector2::ZERO ); + TestDebugVisual( nPatchVisual, Visual::N_PATCH, Vector2::ZERO ); EnvironmentVariable::SetTestingEnvironmentVariable(false); END_TEST;