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-BubbleEmitter.cpp;h=7fa50ed2f3be8b263786e7109c60405f0ccf8e42;hp=e8f0d98668357d28a03a20c03b31f370ed7a8423;hb=538e266eef5a998be3d6d4b6e1019ecd313d59d4;hpb=96d995c2f22cb20080496e7442c4683eccc62a99 diff --git a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp index e8f0d98..7fa50ed 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -99,7 +99,7 @@ int UtcDaliBubbleEmitterNew(void) DALI_TEST_CHECK( emitter ); // Additional check to ensure object is created by checking if it's registered - ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry(); + ObjectRegistry registry = application.GetCore().GetObjectRegistry(); DALI_TEST_CHECK( registry ); gObjectCreatedCallBackCalled = false; registry.ObjectCreatedSignal().Connect( &TestCallback ); @@ -169,7 +169,7 @@ int UtcDaliBubbleEmitterSetBackground(void) Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f )); - RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList(); + RenderTaskList taskList = application.GetScene().GetRenderTaskList(); unsigned int taskCount = taskList.GetTaskCount(); Texture bgImage = CreateSolidColorTexture( application, Color::RED, 50, 50 ); @@ -193,14 +193,22 @@ int UtcDaliBubbleEmitterSetBubbleScale(void) ToolkitTestApplication application; tet_infoline( " UtcDaliBubbleEmitterSetBubbleScale " ); + static std::vector customUniforms = + { + UniformData("uDynamicScale", Property::Type::FLOAT), + }; + + TestGraphicsController& graphics = application.GetGraphicsController(); + graphics.AddCustomUniforms(customUniforms); + Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f )); DALI_TEST_CHECK(emitter); Actor root = emitter.GetRootActor(); - Stage::GetCurrent().Add( root ); - root.SetPosition( Vector3::ZERO ); - root.SetParentOrigin( ParentOrigin::CENTER ); - root.SetAnchorPoint( AnchorPoint::CENTER ); + application.GetScene().Add( root ); + root.SetProperty( Actor::Property::POSITION, Vector3::ZERO ); + root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); TestGlAbstraction& gl = application.GetGlAbstraction(); @@ -259,7 +267,7 @@ int UtcDaliBubbleEmitterSetBubbleDensity02(void) catch(Dali::DaliException& e) { DALI_TEST_PRINT_ASSERT( e ); - DALI_TEST_ASSERT(e, "density>0 && density<=9", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "density > 0 && density <= 9", TEST_LOCATION ); } END_TEST; } @@ -274,7 +282,7 @@ int UtcDaliBubbleEmitterEmitBubble(void) Actor root = emitter.GetRootActor(); Renderer bubbleRenderer = root.GetRendererAt( 0 ); - Stage::GetCurrent().Add( root ); + application.GetScene().Add( root ); DALI_TEST_CHECK( bubbleRenderer ); Property::Index propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" ); @@ -313,17 +321,27 @@ int UtcDaliBubbleEmitterEmitBubble(void) int UtcDaliBubbleEmitterRestore(void) { +#ifdef OLD_GRAPHICS_TEST ToolkitTestApplication application; tet_infoline( " UtcDaliBubbleEmitterRestore " ); + static std::vector customUniforms = + { + UniformData("uPercentage[0]", Property::Type::FLOAT), + UniformData("uStartEndPosition[0]", Property::Type::VECTOR4), + }; + + TestGraphicsController& graphics = application.GetGraphicsController(); + graphics.AddCustomUniforms(customUniforms); + Vector2 movementArea(50.f,50.f); Texture shapeImage = CreateSolidColorTexture( application, Color::GREEN, 5, 5 ); BubbleEmitter emitter = BubbleEmitter::New( movementArea,shapeImage, 90, Vector2( 5.f, 10.f )); Actor root = emitter.GetRootActor(); - Stage::GetCurrent().Add( root ); - root.SetPosition( Vector3::ZERO ); - root.SetParentOrigin( ParentOrigin::CENTER ); - root.SetAnchorPoint( AnchorPoint::CENTER ); + application.GetScene().Add( root ); + root.SetProperty( Actor::Property::POSITION, Vector3::ZERO ); + root.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + root.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Renderer renderer = root.GetRendererAt( 0 ); DALI_TEST_CHECK( renderer ); @@ -365,6 +383,9 @@ int UtcDaliBubbleEmitterRestore(void) DALI_TEST_CHECK( gl.GetUniformValue( "uStartEndPosition[0]", startEndPosValue ) ); DALI_TEST_EQUALS( startEndPosValue, Vector4::ZERO, TEST_LOCATION ); +#else + tet_result(TET_PASS); +#endif END_TEST; }