X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-Visual.cpp;h=f399d4d0f268acf20304808b99f67f5129a62fab;hp=2bf846bd361f249dee207563b0a409212626e88c;hb=0a98cc9159a2b5868987ec7f0b31b76f3dc10259;hpb=cb025df0e861206e3c861743fc483df009248f5b diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index 2bf846b..f399d4d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.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. @@ -286,19 +286,6 @@ int UtcDaliVisualSize(void) svgVisual2.GetNaturalSize(naturalSize); DALI_TEST_EQUALS( naturalSize, Vector2(100.f, 100.f), TEST_LOCATION ); // Natural size should still be 100, 100 - // Batch Image visual - TestPlatformAbstraction& platform = application.GetPlatform(); - Vector2 testSize(80.f, 160.f); - platform.SetClosestImageSize(testSize); - propertyMap.Clear(); - propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - propertyMap.Insert( "batchingEnabled", true ); - Visual::Base batchImageVisual = factory.CreateVisual( propertyMap ); - batchImageVisual.SetTransformAndSize(DefaultTransform(), controlSize ); - batchImageVisual.GetNaturalSize( naturalSize ); - DALI_TEST_EQUALS( naturalSize, Vector2( 80.0f, 160.0f ), TEST_LOCATION ); - // Text visual. // Load some fonts to get the same metrics on different platforms. @@ -957,45 +944,6 @@ int UtcDaliVisualGetPropertyMap9(void) END_TEST; } -int UtcDaliVisualGetPropertyMapBatchImageVisual(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualGetPropertyMapBatchImageVisual:" ); - - VisualFactory factory = VisualFactory::Get(); - Property::Map propertyMap; - propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true ); - propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, 20 ); - propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, 30 ); - - Visual::Base batchImageVisual = factory.CreateVisual( propertyMap ); - DALI_TEST_CHECK( batchImageVisual ); - - Property::Map resultMap; - batchImageVisual.CreatePropertyMap( resultMap ); - - // Check the property values from the returned map from visual - Property::Value* value = resultMap.Find( Visual::Property::TYPE, Property::INTEGER ); - DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == Visual::IMAGE ); - - value = resultMap.Find( ImageVisual::Property::URL, Property::STRING ); - DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == TEST_IMAGE_FILE_NAME ); - - value = resultMap.Find( ImageVisual::Property::DESIRED_WIDTH, Property::INTEGER ); - DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == 20 ); - - value = resultMap.Find( ImageVisual::Property::DESIRED_HEIGHT, Property::INTEGER ); - DALI_TEST_CHECK( value ); - DALI_TEST_CHECK( value->Get() == 30 ); - - END_TEST; -} - //Text shape visual int UtcDaliVisualGetPropertyMap10(void) { @@ -1117,36 +1065,6 @@ int UtcDaliVisualGetPropertyMap11(void) END_TEST; } -int UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas(void) -{ - ToolkitTestApplication application; - tet_infoline( "UtcDaliVisualGetPropertyMapBatchImageVisualNoAtlas:" ); - - VisualFactory factory = VisualFactory::Get(); - Property::Map propertyMap; - propertyMap.Insert( Visual::Property::TYPE, Visual::IMAGE ); - propertyMap.Insert( ImageVisual::Property::BATCHING_ENABLED, true ); - propertyMap.Insert( ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME ); - - // Set the desired size to be larger than the atlas limit of 1024x1024. - propertyMap.Insert( ImageVisual::Property::DESIRED_WIDTH, 2048 ); - propertyMap.Insert( ImageVisual::Property::DESIRED_HEIGHT, 2048 ); - - // Create the visual. - Visual::Base batchImageVisual = factory.CreateVisual( propertyMap ); - - DALI_TEST_CHECK( batchImageVisual ); - - DummyControl dummyControl = DummyControl::New(true); - Impl::DummyControl& dummyImpl = static_cast(dummyControl.GetImplementation()); - dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, batchImageVisual ); - Stage::GetCurrent().Add( dummyControl ); - - DALI_TEST_CHECK( dummyControl.GetRendererCount() == 1u ); - - END_TEST; -} - int UtcDaliVisualAnimateBorderVisual01(void) { ToolkitTestApplication application; @@ -1695,6 +1613,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis //Set a new transform transform.Clear(); + transform = DefaultTransform(); transform.Insert( DevelVisual::Transform::Property::OFFSET, Vector2(20.0f, 20.0f) ); transform.Insert( DevelVisual::Transform::Property::SIZE, Vector2(100.0f, 100.0f) ); transform.Insert( DevelVisual::Transform::Property::OFFSET_SIZE_MODE, Vector4(0.0f, 0.0f, 1.0f,1.0f) ); @@ -2083,8 +2002,8 @@ int UtcDaliVisualTextVisualRender(void) Renderer renderer = dummyControl.GetRendererAt(0u); Property::Index index = renderer.GetPropertyIndex("size"); - tet_infoline( "Test that the TextVisual overrides anything set by developer" ); - DALI_TEST_EQUALS( renderer.GetProperty(index), Vector2( 1.0, 1.0 ), 0.001f, TEST_LOCATION ); + tet_infoline( "Test that the TextVisual has NOT overridden what was set by developer" ); + DALI_TEST_EQUALS( renderer.GetProperty(index), Vector2( 0.5f, 0.5f ), 0.001f, TEST_LOCATION ); END_TEST; }