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-SuperBlurView.cpp;h=20d5f442568616b77a8d4ed0303e11fa8c5fa942;hp=3c121c067b915da67f67e04b4033c0968f04ace7;hb=f4a28993f3f77f15015e5c9b4e1bedd06e23b926;hpb=69e82a1bf2e1e4528efbdc6f87b502263cdfb150 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp index 3c121c0..20d5f44 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.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. @@ -223,14 +223,71 @@ int UtcDaliSuperBlurViewSetImage(void) Wait(application); DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION ); - application.SendNotification(); - application.Render(); + Wait(application); + Stage::GetCurrent().Remove( blurView ); + } + + END_TEST; +} + +int UtcDaliSuperBlurViewSetImage2(void) +{ + ToolkitTestApplication application; + Stage stage = Stage::GetCurrent(); + + tet_infoline(" UtcDaliSuperBlurViewSetImage2 - test setting a second image "); + + SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS ); + blurView.SetSize( 100.f, 100.f ); + + tet_infoline("Call SetImage and add blurview to stage"); + Image inputImage = CreateSolidColorImage( application, Color::GREEN, 50, 50 ); + blurView.SetImage( inputImage ); + + // start multiple guassian blur call, each guassian blur creates two render tasks + DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2); + { + // create image renderers for the original image and each blurred image + stage.Add( blurView ); + Wait(application); + DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION ); + + tet_infoline("Wait for a second to allow blur to finish"); + Wait(application, 1000); + + tet_infoline("Remove from stage"); Stage::GetCurrent().Remove( blurView ); } + tet_infoline("Test that there are no render tasks remaining"); + DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION ); + + tet_infoline("Call SetImage a second time and add blurview back to stage"); + Image inputImage2 = CreateSolidColorImage( application, Color::CYAN, 50, 50 ); + blurView.SetImage( inputImage2 ); + // start multiple guassian blur call, each guassian blur creates two render tasks + DALI_TEST_CHECK( Stage::GetCurrent().GetRenderTaskList().GetTaskCount() == 1+BLUR_LEVELS*2); + + { + // create image renderers for the original image and each blurred image + Stage::GetCurrent().Add( blurView ); + Wait(application); + DALI_TEST_EQUALS(blurView.GetRendererCount(), BLUR_LEVELS+1, TEST_LOCATION ); + + tet_infoline("Wait for a second to allow blur to finish"); + Wait(application, 1000); + + tet_infoline("Remove from stage"); + Stage::GetCurrent().Remove( blurView ); + } + + tet_infoline("Test that there are no render tasks remaining"); + DALI_TEST_EQUALS(blurView.GetRendererCount(), 0, TEST_LOCATION ); + END_TEST; } + int UtcDaliSuperBlurViewSetProperty(void) { ToolkitTestApplication application;