(Automated Tests) Use Scene instead of Stage
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-BubbleEmitter.cpp
index a4575fc..3294f66 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -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 );
@@ -197,10 +197,10 @@ int UtcDaliBubbleEmitterSetBubbleScale(void)
   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();
 
@@ -274,7 +274,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]" );
@@ -288,20 +288,24 @@ int UtcDaliBubbleEmitterEmitBubble(void)
   (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 );
   DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION );
   DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
+  DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION );
+  DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION );
 
   animation.Play();
 
   Wait(application, 300);
   propertyIndex0 = bubbleRenderer.GetPropertyIndex( "uPercentage[0]" );
   propertyIndex1 = bubbleRenderer.GetPropertyIndex( "uPercentage[1]" );
-  (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 );
-  (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
   DALI_TEST_CHECK( value0 >= 0.6f );
   DALI_TEST_CHECK( value1 >= 0.6f );
 
   Wait(application,500);
-  (bubbleRenderer.GetProperty(propertyIndex0)).Get( value0 );
-  (bubbleRenderer.GetProperty(propertyIndex1)).Get( value1 );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value0 );
+  ( bubbleRenderer.GetCurrentProperty( propertyIndex0 ) ).Get( value1 );
   DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION );
   DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION );
   END_TEST;
@@ -316,10 +320,10 @@ int UtcDaliBubbleEmitterRestore(void)
   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 );