(Automated Tests) Use Scene instead of Stage
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Button.cpp
index a2b1a81..92e64ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 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.
@@ -360,9 +360,9 @@ int UtcDaliButtonAutoRepeatingP(void)
   Button button = PushButton::New();
   button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
-  Stage::GetCurrent().Add( button );
+  button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+  button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
+  application.GetScene().Add( button );
 
   application.SendNotification();
   application.Render();
@@ -590,10 +590,10 @@ int UtcDaliButtonPressedSignalP(void)
   Button button = PushButton::New();
   button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
+  button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+  button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add( button );
 
   application.SendNotification();
   application.Render();
@@ -697,10 +697,10 @@ int UtcDaliButtonClickedSignalP(void)
   Button button = PushButton::New();
   button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetPosition( 240, 400 );
-  button.SetSize( 100, 100 );
+  button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+  button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add( button );
 
   application.SendNotification();
   application.Render();
@@ -791,7 +791,7 @@ int UtcDaliButtonStateChangedSignalP(void)
 
   button.SetProperty( Button::Property::TOGGLABLE, true);
 
-  Stage::GetCurrent().Add( button );
+  application.GetScene().Add( button );
 
   application.SendNotification();
   application.Render();
@@ -850,13 +850,13 @@ int UtcDaliButtonEventConsumption(void)
   Button parentButton = PushButton::New();
   parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  parentButton.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( parentButton );
+  parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+  application.GetScene().Add( parentButton );
 
   Button childButton = PushButton::New();
   childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   childButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
-  childButton.SetSize( 20, 20 );
+  childButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
   parentButton.Add( childButton );
 
   // Reset signal flags
@@ -904,8 +904,8 @@ int UtcDaliButtonRelease(void)
   Button parentButton = PushButton::New();
   parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  parentButton.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( parentButton );
+  parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+  application.GetScene().Add( parentButton );
   parentButton.ReleasedSignal().Connect( &ButtonCallback );
 
   // Reset signal flags
@@ -949,8 +949,8 @@ int UtcDaliButtonMultiTouch(void)
 
   button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
-  button.SetSize( 20, 20 );
-  Stage::GetCurrent().Add( button );
+  button.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
+  application.GetScene().Add( button );
   button.ReleasedSignal().Connect( &ButtonCallback );
 
   // Reset signal flags