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=29676392935e83ac40ba1686e5c9d33b89764a92;hp=3c121c067b915da67f67e04b4033c0968f04ace7;hb=5e351965bad7e1de2e94027548b022bac692603c;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..2967639 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. @@ -102,15 +102,9 @@ Image CreateSolidColorImage( ToolkitTestApplication& application, const Vector4& void LoadBitmapResource(TestPlatformAbstraction& platform, int width, int height) { - Integration::ResourceRequest* request = platform.GetRequest(); Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD ); Integration::ResourcePointer resource(bitmap); bitmap->GetPackedPixelsProfile()->ReserveBuffer(Pixel::RGBA8888, width, height, width, height); - - if(request) - { - platform.SetResourceLoaded(request->GetId(), request->GetType()->id, resource); - } } class SignalHandler : public Dali::ConnectionTracker @@ -223,14 +217,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;