X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Futc-Dali-ImageView.cpp;h=12c3f1742ec5b67e765f4c546fa0df0e1c95a394;hb=2cfc2d43f2365794591eddc96f6c5ec029cab28d;hp=5955748f51f40f87063402698eab0b8002c2b9b3;hpb=1b0a5f5931b61343586de7cd62fd44793c79ae73;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index 5955748..12c3f17 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 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. @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -351,10 +351,10 @@ int UtcDaliImageViewSetGetProperty03(void) int destFactorRgb = renderer.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB ); int srcFactorAlpha = renderer.GetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA ); int destFactorAlpha = renderer.GetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA ); - DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::ONE ); - DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA ); - DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE ); - DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE ); + DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA ); + DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE ); + DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE ); value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA ); DALI_TEST_CHECK( value.Get( enable ) ); @@ -393,6 +393,7 @@ int UtcDaliImageViewAsyncLoadingWithAltasing(void) callStack.Reset(); callStack.Enable(true); + BitmapLoader::ResetLatestCreated(); ImageView imageView = ImageView::New( gImage_34_RGBA, ImageDimensions( 34, 34 ) ); // By default, Aysnc loading is used @@ -417,6 +418,7 @@ int UtcDaliImageViewAsyncLoadingWithAltasing(void) loader.WaitForLoading();// waiting until the image to be loaded DALI_TEST_CHECK( loader.IsLoaded() ); + eventTrigger->WaitingForTrigger( 1 ); CallbackBase* callback = eventTrigger->GetCallback(); CallbackBase::Execute( *callback ); @@ -425,8 +427,10 @@ int UtcDaliImageViewAsyncLoadingWithAltasing(void) callStack.Enable(false); - DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) ); - + TraceCallStack::NamedParams params; + params["width"] = ToString(34); + params["height"] = ToString(34); + DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), true, TEST_LOCATION ); END_TEST; } @@ -440,9 +444,10 @@ int UtcDaliImageViewSyncLoading(void) // Sync loading, no atlasing for big size image { - ImageView imageView = ImageView::New( gImage_600_RGB ); + ImageView imageView = ImageView::New(); // Sync loading is used + syncLoadingMap[ ImageVisual::Property::URL ] = gImage_600_RGB; imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap ); // BitmapLoader is used, and the loading is started immediately even the actor is not on stage. @@ -459,9 +464,9 @@ int UtcDaliImageViewSyncLoading(void) ImageView imageView = ImageView::New( ); // Sync loading is used - syncLoadingMap[ "url" ] = gImage_34_RGBA; - syncLoadingMap[ "desiredHeight" ] = 34; - syncLoadingMap[ "desiredWidth" ] = 34; + syncLoadingMap[ ImageVisual::Property::URL ] = gImage_34_RGBA; + syncLoadingMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 34; + syncLoadingMap[ ImageVisual::Property::DESIRED_WIDTH ] = 34; imageView.SetProperty( ImageView::Property::IMAGE, syncLoadingMap ); // loading is started even if the actor is offStage @@ -475,9 +480,13 @@ int UtcDaliImageViewSyncLoading(void) Stage::GetCurrent().Add( imageView ); application.SendNotification(); application.Render(16); - DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", "0, 0, 34, 34" ) ); - } + TraceCallStack::NamedParams params; + params["width"] = ToString(34); + params["height"] = ToString(34); + DALI_TEST_EQUALS( callStack.FindMethodAndParams( "TexSubImage2D", params ), + true, TEST_LOCATION ); + } END_TEST; } @@ -987,7 +996,6 @@ int UtcDaliImageViewSetImageNativeImageWithCustomShader(void) customShader.Insert( "hints", shaderHints ); Property::Map map; - map.Insert( "rendererType", "image" ); map.Insert( "shader", customShader ); TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height ); @@ -997,8 +1005,6 @@ int UtcDaliImageViewSetImageNativeImageWithCustomShader(void) imageView.SetProperty( ImageView::Property::IMAGE, map ); Stage::GetCurrent().Add( imageView ); - imageView.SetProperty( ImageView::Property::IMAGE, map ); - TestGlAbstraction& gl = application.GetGlAbstraction(); gl.EnableTextureCallTrace( true ); @@ -1039,7 +1045,6 @@ int UtcDaliImageViewSetImageBufferImageWithCustomShaderToNativeImage(void) customShader.Insert( "hints", shaderHints ); Property::Map map; - map.Insert( "rendererType", "image" ); map.Insert( "shader", customShader ); BufferImage image = CreateBufferImage( width, height, Color::WHITE ); @@ -1048,8 +1053,6 @@ int UtcDaliImageViewSetImageBufferImageWithCustomShaderToNativeImage(void) imageView.SetProperty( ImageView::Property::IMAGE, map ); Stage::GetCurrent().Add( imageView ); - imageView.SetProperty( ImageView::Property::IMAGE, map ); - TestGlAbstraction& gl = application.GetGlAbstraction(); gl.EnableTextureCallTrace( true ); @@ -1128,4 +1131,3 @@ int UtcDaliImageViewGetImageN(void) END_TEST; } -