X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit-internal%2Futc-Dali-TextureManager.cpp;h=9098be8d23ac27efe3186374d1fc96e3c057934e;hb=99767a25b9069cc9fdb0d1b5d046a19016531fb0;hp=f2b032d704a5dede328835d7f49e798a5f2c4ebf;hpb=7cfada64ad44d4a47785d49993b298f1c2dbd4a0;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp index f2b032d..9098be8 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp @@ -25,14 +25,21 @@ #include #include #include +#include -using namespace Dali::Toolkit::Internal; +#if defined(ELDBUS_ENABLED) +#include +#endif +using namespace Dali::Toolkit::Internal; void utc_dali_toolkit_texture_manager_startup(void) { setenv( "LOG_TEXTURE_MANAGER", "3", 1 ); test_return_value = TET_UNDEF; +#if defined(ELDBUS_ENABLED) + DBusWrapper::Install(std::unique_ptr(new TestDBusWrapper)); +#endif } void utc_dali_toolkit_texture_manager_cleanup(void) @@ -204,3 +211,70 @@ int UtcTextureManagerCachingForDifferentLoadingType(void) END_TEST; } + +int UtcTextureManagerUseInvalidMask(void) +{ + ToolkitTestApplication application; + tet_infoline( "UtcTextureManagerUseInvalidMask" ); + + TextureManager textureManager; // Create new texture manager + + TestObserver observer; + std::string filename( TEST_IMAGE_FILE_NAME ); + std::string maskname(""); + TextureManager::MaskingDataPointer maskInfo = nullptr; + maskInfo.reset(new TextureManager::MaskingData()); + maskInfo->mAlphaMaskUrl = maskname; + maskInfo->mAlphaMaskId = TextureManager::INVALID_TEXTURE_ID; + maskInfo->mCropToMask = true; + maskInfo->mContentScaleFactor = 1.0f; + + auto textureId( TextureManager::INVALID_TEXTURE_ID ); + Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f ); + Dali::ImageDimensions atlasRectSize( 0,0 ); + bool synchronousLoading(false); + bool atlasingStatus(false); + bool loadingStatus(false); + auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; + ImageAtlasManagerPtr atlasManager = nullptr; + Toolkit::AtlasUploadObserver* atlasUploadObserver = nullptr; + + textureManager.LoadTexture( + filename, + ImageDimensions(), + FittingMode::SCALE_TO_FILL, + SamplingMode::BOX_THEN_LINEAR, + maskInfo, + synchronousLoading, + textureId, + atlasRect, + atlasRectSize, + atlasingStatus, + loadingStatus, + WrapMode::DEFAULT, + WrapMode::DEFAULT, + &observer, + atlasUploadObserver, + atlasManager, + true, + TextureManager::ReloadPolicy::CACHED, + preMultiply + ); + + DALI_TEST_EQUALS( observer.mLoaded, false, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mObserverCalled, false, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + DALI_TEST_EQUALS( observer.mLoaded, true, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mObserverCalled, true, TEST_LOCATION ); + DALI_TEST_EQUALS( observer.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION ); + + END_TEST; +}